Forum Moderators: not2easy

Message Too Old, No Replies

How to stop anchor-text wrapping

         

reddevil

6:04 pm on Oct 16, 2005 (gmt 0)

10+ Year Member



I have a bottom menu with a number of different links. These menus will change depending on the topic of the page.

I want to stop the longer links (eg. the links with more than one word) from wrapping onto the next line and would like to keep the coding to W3C standards (html 4.01 transitional).

I have fumbled with white-space:nowrap; and a couple of other commands but with no success.

Please could anyone help?

Tidal2

7:49 pm on Oct 16, 2005 (gmt 0)

10+ Year Member



Its not a css solution but what about using a non breaking space in html

<a href="index.html">Site&nbsp;Name</a>

moltar

8:13 pm on Oct 16, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



try
white-space: nowrap
. It's a valid CSS property, but I am not sure how do different browsers support it. Test it to see if it works 100%.

reddevil

5:18 pm on Oct 17, 2005 (gmt 0)

10+ Year Member



Cheers moltar, that works even better than it should (haha). Now I have one line that is 3 screens wide (hohoho).

Still trying to find some more time to fiddle with it.

Lynque

2:10 am on Oct 18, 2005 (gmt 0)

10+ Year Member



hello reddevil,

maybe try display:block;?

moltar

3:29 am on Oct 18, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Now I have one line that is 3 screens wide (hohoho).

I assume you applied that property on the container of the links. Try applying the property to the link tags. E.g.

a { white-space: nowrap }

xfinx

7:32 am on Oct 18, 2005 (gmt 0)

10+ Year Member



as it the a most of the time is not broken, you'd better try to give a width, (you might need to use display:block aswell)

reddevil

1:03 pm on Oct 18, 2005 (gmt 0)

10+ Year Member



a { white-space: nowrap }

moltar - you are absolutely right - this is the magic code that I was searching for.

Thanks a bunch, the menu looks much more organised now.