Jump to content


Photo

Center nav bar on platform pro


This topic has been archived. This means that you cannot reply to this topic.
5 replies to this topic

#1 salesdigitalheavenscouk

salesdigitalheavenscouk

    Advanced Member

  • Members
  • PipPipPip
  • 65 posts

Posted 12 November 2010 - 11:52 AM

Hi guys, im just wondering if you can center the main nav bar in platform pro and if you can whats the css code? Chears Stewart wood www.digitalheavens.co.uk

#2 cmlstudios

cmlstudios

    Advanced Member

  • Members
  • PipPipPip
  • 66 posts

Posted 12 November 2010 - 06:22 PM

You can sortof force it to center but it's not very future-proof (i.e., if you add a new menu you have to re-work this css).

 #nav ul, #nav .mnav {
	margin:0 0 0 40px;
	width:850px;
	}


#3 nett-ed

nett-ed

    Advanced Member

  • Members
  • PipPipPip
  • 53 posts

Posted 12 November 2010 - 06:27 PM

Something along these lines I think would do it
 #primary-nav ul {
	float:none;
	margin:0 auto;
	width:500px;
	}

You would need to modify width to adapt to the number of links you have.

#4 cmlstudios

cmlstudios

    Advanced Member

  • Members
  • PipPipPip
  • 66 posts

Posted 12 November 2010 - 07:51 PM

Yep Eduardo's point is better -- remove the float and you can auto-center with the margin property. Still need to be aware of total width but don't have to finagle as much for centering alignment.

 #nav ul, #nav .mnav {
	float:none;
	margin:0 auto;
	width:840px;
	}


#5 salesdigitalheavenscouk

salesdigitalheavenscouk

    Advanced Member

  • Members
  • PipPipPip
  • 65 posts

Posted 13 November 2010 - 11:38 AM

That doesn??™t seem to work as I thought :(. The buttons stack on top of each other so I get a vertical bar going up the middle.

#6 catrina

catrina

    Advocate

  • Members
  • 12345 posts

Posted 13 November 2010 - 07:29 PM

Try this one:

 #menu-main-menu ul class.mnav {
	margin:0 auto;
	width:840px;
	}