![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
I've been trying to create a simple vertical navigation bar, using (as recommended) an unordered list (UL) of hyperlinks. I'd like to have a hover effect, so I have to style the links themselves. ul.links a:link, ul.links a:visited { color: #FFFFFF; background-color: #000000; } ul.links a:hover, ul.links a:active { color: #FF0000; background-color: #FFFFFF; My problem is that because the link text length varies, the width of the background also varies, giving an awful ragged effect on the right-hand-side. I've seen this done beautifully (but can't now find an example). Any suggestions? |
#3
| |||
| |||
|
|
ul.links a:link, ul.links a:visited { color: #FFFFFF; background-color: #000000; } |
|
My problem is that because the link text length varies, the width of the background also varies, giving an awful ragged effect on the right-hand-side. I've seen this done beautifully (but can't now find an example). Any suggestions? |
#4
| |||
| |||
|
|
I've been trying to create a simple vertical navigation bar, using (as recommended) an unordered list (UL) of hyperlinks. I'd like to have a hover effect, so I have to style the links themselves. ul.links a:link, ul.links a:visited { color: #FFFFFF; background-color: #000000; } ul.links a:hover, ul.links a:active { color: #FF0000; background-color: #FFFFFF; My problem is that because the link text length varies, the width of the background also varies, giving an awful ragged effect on the right-hand-side. I've seen this done beautifully (but can't now find an example). |
|
Any suggestions? |
#5
| |||
| |||
|
|
Philip Herlihy wrote: snip ul.links a:link, ul.links a:visited { color: #FFFFFF; background-color: #000000; } snip My problem is that because the link text length varies, the width of the background also varies, giving an awful ragged effect on the right-hand-side. I've seen this done beautifully (but can't now find an example). Any suggestions? ul.links { width: 10em; } Thanks for the reply, Philip, but that doesn't seem to do the trick... |
#6
| |||
| |||
|
|
On Mon, 22 Nov 2004 10:29:02 +0000 (UTC), Philip Herlihy foof8501 (AT) herlihy (DOT) eu.veil.com> wrote: I've been trying to create a simple vertical navigation bar, using (as recommended) an unordered list (UL) of hyperlinks. I'd like to have a hover effect, so I have to style the links themselves. ul.links a:link, ul.links a:visited { color: #FFFFFF; background-color: #000000; } ul.links a:hover, ul.links a:active { color: #FF0000; background-color: #FFFFFF; My problem is that because the link text length varies, the width of the background also varies, giving an awful ragged effect on the right-hand-side. I've seen this done beautifully (but can't now find an example). Any suggestions? How about setting a width on <li> and setting the width for <a> and all the pseudoclasses as necessary on 100%? |
#7
| |||
| |||
|
|
Philip Herlihy wrote: I've been trying to create a simple vertical navigation bar, using (as recommended) an unordered list (UL) of hyperlinks. I'd like to have a hover effect, so I have to style the links themselves. ul.links a:link, ul.links a:visited { color: #FFFFFF; background-color: #000000; } ul.links a:hover, ul.links a:active { color: #FF0000; background-color: #FFFFFF; My problem is that because the link text length varies, the width of the background also varies, giving an awful ragged effect on the right-hand-side. I've seen this done beautifully (but can't now find an example). See link in sig ;-) Any suggestions? Set a width (in ems) to the <li> element, and set the <a element to display:block; width:100%. -- Els http://locusmeus.com/ .... |
#8
| |||
| |||
|
|
"Barbara de Zoete" <b_de_zoete (AT) hotmail (DOT) com> wrote in message news pshu30yhvx5vgts (AT) zoete_b (DOT) ..On Mon, 22 Nov 2004 10:29:02 +0000 (UTC), Philip Herlihy foof8501 (AT) herlihy (DOT) eu.veil.com> wrote: I've been trying to create a simple vertical navigation bar, using (as recommended) an unordered list (UL) of hyperlinks. I'd like to have a hover effect, so I have to style the links themselves. ul.links a:link, ul.links a:visited { color: #FFFFFF; background-color: #000000; } ul.links a:hover, ul.links a:active { color: #FF0000; background-color: #FFFFFF; My problem is that because the link text length varies, the width of the background also varies, giving an awful ragged effect on the right-hand-side. I've seen this done beautifully (but can't now find an example). Any suggestions? How about setting a width on <li> and setting the width for <a> and all the pseudoclasses as necessary on 100%? Almost! Need to set display: block; on the <a> (as suggested by Els) |
|
Thanks! Your welcome |
#9
| |||
| |||
|
|
Els wrote: Philip Herlihy wrote: I've been trying to create a simple vertical navigation bar, using (as recommended) an unordered list (UL) of hyperlinks. I'd like to have a hover effect, so I have to style the links themselves. My problem is that because the link text length varies, the width of the background also varies, giving an awful ragged effect on the right-hand-side. Set a width (in ems) to the <li> element, and set the <a> element to display:block; width:100%. width: 100% only for broken MSIE/Win. Use width: auto for Firefox and Opera. .... |
#10
| |||
| |||
|
|
I've been trying to create a simple vertical navigation bar, using (as recommended) an unordered list (UL) of hyperlinks. I'd like to have a hover effect, so I have to style the links themselves. .... My problem is that because the link text length varies, the width of the background also varies, giving an awful ragged effect on the right-hand-side. I've seen this done beautifully (but can't now find an example). Any suggestions? |
![]() |
| Thread Tools | |
| Display Modes | |
| |