Jump to content

Fluid Layout And Absolute Top Position


johnnyg24
 Share

Recommended Posts

I am trying to create a fluid layout where say a div is 90% wide and always centered. The problem I keep running into is when I try to set the top position to 50px. When I set the position to absolute and top to 50px, the positioning works but then the centering does not. Any help would be greatly appreciated. Here is what I have so far without the top positioning :

#topNav {background-color:#9900FF;width:90%;margin-left:auto;margin-right:auto;}

Link to comment
Share on other sites

Don't set top position, set margin-top: 50px instead.

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
 Share

×
×
  • Create New...