code blue
05-05-2006, 07:43 AM
Hi everyone - long time browser, first time poster.
I'm trying to put together a site at the moment where accessibility and useability are key factors, but the client still wants to work to a fairly rigid design. the problem is they have a horizontal nav bar, where i need to be able to set the width of each navigational link. Im trying to do this using an unordered list for the navigation items, but im having trouble styling individual <li>s (i'd like to be able to control the width of each <li seperately>).
navbar code is very straight forward:
<div id="navBar">
<ul>
<li class="home">Home</li>
<li class="products">Depend Products</li>
<li class="prof">For Professionals</li>
</ul>
</div>
as is css:
#navBar ul {
list-style-type: none;
display: inline;
padding: 0;
margin: 0;
}
#navBar li {
display: inline;
padding: 0;
margin: 0;
text-align: center;
height: 1.6em;
}
#navbar ul .home{
width: 100px;
}
#navbar ul .products{
width: 150px;
}
the problem is - the widths (or any other property i attach) aren't being applied to the <li>s themselves. i have done this before in a vertical list, and it worked, is the problem just because this is a horizontal list using display:inline ?
any suggestions would be much apprecaited.
cheers.
I'm trying to put together a site at the moment where accessibility and useability are key factors, but the client still wants to work to a fairly rigid design. the problem is they have a horizontal nav bar, where i need to be able to set the width of each navigational link. Im trying to do this using an unordered list for the navigation items, but im having trouble styling individual <li>s (i'd like to be able to control the width of each <li seperately>).
navbar code is very straight forward:
<div id="navBar">
<ul>
<li class="home">Home</li>
<li class="products">Depend Products</li>
<li class="prof">For Professionals</li>
</ul>
</div>
as is css:
#navBar ul {
list-style-type: none;
display: inline;
padding: 0;
margin: 0;
}
#navBar li {
display: inline;
padding: 0;
margin: 0;
text-align: center;
height: 1.6em;
}
#navbar ul .home{
width: 100px;
}
#navbar ul .products{
width: 150px;
}
the problem is - the widths (or any other property i attach) aren't being applied to the <li>s themselves. i have done this before in a vertical list, and it worked, is the problem just because this is a horizontal list using display:inline ?
any suggestions would be much apprecaited.
cheers.