#nav{
list-style:none; /* must be set to none */
font-weight:bold;/* font of the nav menu */
[B]margin-left:200px;/[/B]* shifts whole nav menu 220px from the left */
margin-bottom:10px;/* 10 px from the bottom */
width:50%;
z-index:5;/* sets nav menu ontop of all others */
}
The margin left makes the window keep the 200px on resize however I want it fixed to a certain position when I resize the window, I can’t use auto because it aligns the menu all the way to the left and I need it to be 200px over by default.
So in essence i need a window variable that updates upon window resize. how can I code this?
You could set that left margin to % rather than px to allow it to resize. But to be honest, I suspect there are more issues that just this. There are probably more reliable strategies still, but to advise properly, it would be better for us to see a live link or at least the full page code.
OK, so more styles need to be amended down the line. But you must have those <ul> tags at the start and end, as otherwise your code is invalid and unreliable. Put that code in and then we can fix the other issues.
Awesome job, that’s exactly what I wanted. One more little thing, how can i make all the header boxes containing (HOME, HTML5 ,CSS ,) the same size as you can see it’s formatting the box size based on the widest drop down box element.
Yes, I had a feeling you’d want that. (I couldn’t remember if they were all the same width before.)
You could add these styles:
#nav ul ul {position: absolute;}
#nav ul li {width: 120px;}
#nav ul li li {width: 100%;}
You may be able to incorporate some of these with existing styles: it’s just easier to write them separately when I’m testing this.
You can alter the width of the top level LIs. I just chose 120px.
I can’t guarantee this will work in all browsers, though. IE tends to be a real pain. Perhaps try these styles first, and then we can see how to deal with rubbish browsers. I’ve only tested this in Firefox, and need the changes to be online befre I can test other browsers.