For the main nav of my site, there is a 980px wide div with a ul for the main nav links. I am trying to make the nav links stretch to fit the width of the div evenly.
<div style="width: 980px;">
<ul id="horizontal-style">
<li><a href="#">Nav Item</a></li>
<li><a href="#">Short Item</a></li>
<li><a href="#">Really Long Nav Item</a></li>
<li><a href="#">Nav Link</a></li>
<li><a href="#">Another Link</a></li>
</ul>
</div>
I am doing some typical css to make the ul list horizontally (float: left, display: block). I can tweak the padding of the li to get it very close, but what I really need is a way to make it stretch to fit automatically. Possible?
Edit
Difficulty 1: Can't use tables.
Difficulty 2: Each nav item will be a different width to accommodate longer and shorter link names.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…