Jump to content

center navigation


ShynedM

Recommended Posts

Hi,

 

I've downloaded a template and I'm now editing it in Dreamweaver. I am trying to center the top navigation menu, and from some reason I can't do it. Please see attached screen shot of the style sheet. Any advice would be helpful.

 

Many thanks

 

 

post-199545-0-52893500-1465459421_thumb.png

Link to comment
Share on other sites

It's probably because the elements inside are floated to the left.

 

If you remove the float rule from the menu items, set their display to inline-block and at the text-align property of the parent to "center" it probably will work.

Link to comment
Share on other sites

at the moment it looks like that:

/* Top Nav */

.top-nav li a, .background-white .top-nav li a {
color: #002633;
font-size: 0.9em;
padding: 0.7em 1.25em;
}
nav {
border-bottom: 4px solid rgba(0, 0, 0, 0.05);
border-top: 1px solid rgba(0, 0, 0, 0.05);
padding: 1.7em 0;
position: inline-block;
z-index: 2;
Link to comment
Share on other sites

Set the display property (not position) of the list items to "inline-block". Then set the text-align property of their container (probably .top-nav) to "center".

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...