Center site title and menu – Twenty Eleven child theme
-
I’m trying to center a site title and menu; center it so that as the screen is resized it stays centered (ie. I cannot use fixed pixel widths). The site:
At the moment, gleaned from various sources I’m using this CSS for the title:
/* centre header */
#site-title {
position: relative;
width: 50%;
margin: 0px auto;
}And this CSS for the menu:
/* moving menu up and left */
#access {
background: #fff; /* Show a solid color for older browsers */
-webkit-box-shadow: none;
-moz-box-shadow: none;
box-shadow: none;
position: relative;
top: -50px;
left: -40px;
}/* something below works */
#access {
display:block;
z-index:999;
text-align:center;
}.menu {
overflow: hidden;
}.menu ul {
overflow: hidden;
text-align: center;
}.menu li{
display: inline-block;
float: none !important;
}But it is imperfect; not exactly centered, and because I’m pushing the menu left a bit to try to center it, when the screen is made smaller it moves left.
I’ve seen this question on the forum and elsewhere but have yet to find the solution.
- The topic ‘Center site title and menu – Twenty Eleven child theme’ is closed to new replies.