On 1/31/14, 1:03 PM, Jukka K. Korpela wrote:
2014-01-31 22:53, Tom Livingston wrote:
[...] won't the longest link push out the width of the
<li>s? In which case setting display: block; on the <a>s will cause
them to always be as wise as the widest one? And this will result in
what the OP wanted, no?
No, the <li> elements too have width: auto by default, so they extend over the
available horizontal space, minus the left padding and/or margin. So the
underline, when applied to a block element inside <li>, will extend that way
too, quite independently of the lengths of the texts. That’s how blocks behave.
Yucca
Too true. But you can give the containing <ul> or <ol> a "shrink to fit" the
longest link length, for example by floating it, or giving it
"display:inline-block;". Maybe?
—-
Cordially,
David
______________________________________________________________________
css-discuss [[email protected]]
http://www.css-discuss.org/mailman/listinfo/css-d
List wiki/FAQ -- http://css-discuss.incutio.com/
List policies -- http://css-discuss.org/policies.html
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/