Jump to content

Fixed div moving anyways


Baxtex

Recommended Posts

Okay so I got this horizontal menu bar which I had positioned with absolute:relative to put it were I want it. It stays in place when resizing the browser windows left and right but not up and down as my menu seem to float up or down. I tried switching to position:fixed but it doesn't work either.

 

When I got divs that are either relative or fixed I can't seem to move them either up or down only at the sides. I can move them up and down with absolute, but that makes them move when I resize my window.

 

Here is the code;

<div id="mainmenu">										<ul>						<li><a href="#">Om oss</a></li>						<li><a href="#">Öppettider</a></li>						<li><a href="#">Hitta hit</a></li>						<li><a href="#">Kontakta oss</a></li>							</ul>				</div>
#mainmenu{background-color:black;width:600px;font-size:1.2em;font-weight:bold;text-align:left;border-radius:2px;margin:40px auto;position:absolute;top:17%;left:19%;}
Edited by Baxtex
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...