Jump to content


Photo

How to center align the navigation menu


  • Please log in to reply
5 replies to this topic

#1 rpacker

rpacker

    Super Member

  • Members
  • 232 posts
  • LocationWashington, DC
  • Framework Version:2.3.5
  • Country: Country Flag

Posted 02 November 2011 - 03:59 PM

I need to center (not shift) the main navigation menu. I think it should be something like this: .main_nav ul li {text-align:center} but its not working.

#2 Rob

Rob

    One Smart Egg

  • Members
  • 13575 posts
  • LocationEast Coast, USA
  • Framework Version:The Latest, of course
  • Country: Country Flag

Posted 02 November 2011 - 05:33 PM

.main_nav ul li {text-align:center} won't work. It might this way: .main_nav ul li {text-align:center;} You dropped the closing " ; ".

#3 rpacker

rpacker

    Super Member

  • Members
  • 232 posts
  • LocationWashington, DC
  • Framework Version:2.3.5
  • Country: Country Flag

Posted 02 November 2011 - 05:45 PM

That didn't work either.

#4 Rob

Rob

    One Smart Egg

  • Members
  • 13575 posts
  • LocationEast Coast, USA
  • Framework Version:The Latest, of course
  • Country: Country Flag

Posted 02 November 2011 - 06:04 PM

Please provide a link to your site. I'll take a look.

#5 rpacker

rpacker

    Super Member

  • Members
  • 232 posts
  • LocationWashington, DC
  • Framework Version:2.3.5
  • Country: Country Flag

Posted 02 November 2011 - 06:27 PM

http://www.randallpacker.com/ the menu says: "life in general", "mysterious" , etc.

#6 kastelic

kastelic

    Advocate

  • Members

  • 3081 posts
  • Country: Country Flag

Posted 02 November 2011 - 10:13 PM

The easiest way is to add a margin-left to the menu:

 
	#primary-nav ul.main-nav {
	   margin-left:150px;
	}

or you can give it a width and align it center:

 
	#nav_row{
	   width:510px;
	   margin:0 auto;
	}