So I have a sidebar navigation system working of nested
unordered lists.
I've put the whole thing in a div and set the width of that div. Then I've set list-style-type: none because I don't want the bullets. That leaves my navigation shifted about 30 pixels to the right inside my div so I use a relative position to shift it left 30 pixels.
This whole process leaves the total div the right width, and puts the left side of my navigation where I want it, but it leaves 30 pixels of dead color in my div, causing my links to wrap way too early and often.
If I set my width in list tag instead I end up with the same problem. Is there a way to reclaim these 30 pixels for my list without modifying the width of the DIV?
I imagine I could set an absolute for the div and the list and set everything just so... but that defeats my purpose of being able to move things around naturally.
Obviouslly there's plenty more code, but I believe this covers the issues at hand, let me know if not.
unordered lists.
I've put the whole thing in a div and set the width of that div. Then I've set list-style-type: none because I don't want the bullets. That leaves my navigation shifted about 30 pixels to the right inside my div so I use a relative position to shift it left 30 pixels.
This whole process leaves the total div the right width, and puts the left side of my navigation where I want it, but it leaves 30 pixels of dead color in my div, causing my links to wrap way too early and often.
If I set my width in list tag instead I end up with the same problem. Is there a way to reclaim these 30 pixels for my list without modifying the width of the DIV?
I imagine I could set an absolute for the div and the list and set everything just so... but that defeats my purpose of being able to move things around naturally.
Obviouslly there's plenty more code, but I believe this covers the issues at hand, let me know if not.
Code:
#sideNav {
position : absolute;
width : 170px;
background: #CCC;
margin-top: 5px;
font-size: 80%;
left : 10px;
padding-bottom: 125px;
padding-top: 5px;
border-right: 2px solid #000000;
border-bottom : 2px solid #000;
border-top:1px solid #000;
border-left:1px solid #000;
}
ul#persistentNav
{
list-style-type: none;
position : relative;
left : -30px;
}
Code:
<div id="sideNav">
<ul id="persistentNav">
<li class="cat">Category1
<ul id="subNav">
<li class="link"><a class="nav" href="...">Link1</a></li>
</ul>
and so on
</li>
and so on
</ul>