[Theme: Twenty Twelve] Centering masthead elements
-
Hey folks,
I’m a little embarrassed that I can’t figure this out on my own, but I’ve been out of the HTML/CSS realm for a while now. Trying to run a slightly custom version of theme Twenty Twelve and I’d like to center the optional header image and navigation text. I’m not going to use the site title or tagline display (they are currently visible), but I have managed to get them centered if I choose to use them later.
My style sheet is located here and my page is hosted at http://www.neatandkeen.com.
All of the elements I’d like centered are in the tag
<header id="masthead" class="site-header" role="banner">The custom header does not appear to be inside any other tag or div element.
The site title and tagline (which ultimately I’m not going to use) are inside <hrgroup> tags.
The navigation is inside
<nav id="site-navigation" class="main-navigation" role="navigation">I know I should probably have these changes in a child theme, but I have a backup copy of 2012 available if I need to go back to the source.
Edit: Got the header centered by wrapping <h1> tags around it, but still having difficulty with the menu. I’m trying to add
margin: 0 auto;to various attributes, but doesn’t seem to take effect where I want it.Edit 2: Got it! The trick was to add
margin: 0 auto;
to.main-navigation ul.nav-menu, .main-navigation div.nav-menu > ul
The topic ‘[Theme: Twenty Twelve] Centering masthead elements’ is closed to new replies.