Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums CSS Div placement and animated NAV – CSS help! Re: Div placement and animated NAV – CSS help!

#50403
Spunkmeyer
Member

Considering you have a width assigned to #nav, I would add #nav{margin: 0 auto;} to center the item instead of doing the math. Add a relative position to it, and use top:whatever number; to move it down the page to whatever height you want.

So, something like #nav {height:31px; width:381px; margin:0 auto; position:relative; top:-15px; background-color:#ccc; }

Adding "position:relative;" will position the element in relation to it’s normal position. So, if you were to just add the div with nothing, it would appear in the top left corner of the screen. Adding "margin:0 auto;" will center the element, while "top:-15px;" will position the element 15px up from the bottom of #logo. Just experiment with the numbers a little and you’ll get the right position. If you were to use : "position:relative; top:0;" instead, it would position your #nav right at the bottom of #logo as opposed to being kind-of inside it.

And for the menu, just Google horizontal CSS menus. You should be able to find everything you need.