Jump to content

Nobr


khadem1386
 Share

Recommended Posts

HiI have an HTML code generator this it makes a list.each item of list is like this :

<nobr><a target="" href="www.google.asp">AAAA bbbbbbb ccccc</a></nobr>

I want wrap this line, for example:

AAAA bbbbbbbccccc

Is there any trick in CSS to make <nobr> and   disable?for example:.nobr{white-space :normal }There is tow matter:1- Nobr2-  these parameters don't allow my text to wrap.is there any way to make disable this problem by css?Thanks

Link to comment
Share on other sites

I wouldn't suggest using the <nobr> element. It's not even real HTML, it's made up by some old browser vendor or another.If you learnt CSS properly, you would know that you can style all elements of a certain name by simply putting the name as the selector:

nobr { /* CSS here */ }

&nbsp; is an entity, in other words, it's a character just like the letter 'A'. You can't style individual characters. The purpose of &nbsp; is specifically to prevent text wrapping. Don't use it if you want the text to wrap, just put a normal space there.You should make your pages in a text editor. If you let another editor generate your HTML it's always going to have mistakes.

Link to comment
Share on other sites

In place of a <nobr> element, try using something like this: <p class="nobr">now your CSS might look likep.nobr { /* CSS here */ }The dot makes a HUGE difference in CSS. It defines a class instead of an element, and that is what you want, because you cannot count on a <nobr> element even existing.

Edited by Deirdre's Dad
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...