- This topic is empty.
-
AuthorPosts
-
November 10, 2016 at 2:56 am #247707solostParticipant
Hey guys, bit of a newb to wordpress/CSS and got stuck pretty early on. Alligning right and left work fine, but centre doesn’t. Attached a screenshot to show what menu and logo look like when centred. CSS here too. Did I do something stupid?
https://s18.postimg.org/4qelmaxg9/Screen_Shot_2016_11_10_at_09_48_58.png
From the stylesheet:
#container {
text-align: centre;
margin: 0 auto;
position: relative;
}
#container, #infinite-footer .container {
width: 1280px;
}
#main-header {
margin-top: 80px;
}
#logo {
float: centre;
margin-bottom: 10;
text-transform: none;
font-size: 38px;
letter-spacing: 9px;
margin-right: 30px;
font-weight: 100;
}
#logo a {
text-decoration: none;
color: #000;
}
#logo a:hover {
color: rgba(0, 0, 0, 0.5);
}
#top-menu {
float: centre;
padding-top: 14px;
position: relative;
}
#top-menu li {
display: inline-block;
font-size: 20px;
margin-right: 30px;
}
#top-menu a {
color: #000;
text-decoration: none;
padding-bottom: 10px;
display: block;
position: relative;November 10, 2016 at 3:36 am #247710SenffParticipantJust a screenshot and a little bit of code is probably not enough to figure out the problem or explain how to solve it — it would be better if you could give us a link to your site or if you could create a reduced case in Codepen.io.
Having said that, from your code I can see there’s a few things:
– “text-align: centre;” should be “text-align: center;”
– “float: centre;” (or rather, “float: center;”) doesn’t existBasically, you’ll need something like this:
http://codepen.io/senff/pen/ENPYZa
It’s just a start, but in order to make things centered, keep in mind:
– set “text-align:center;” on the outer container (#container in this case), and
– none of the elements inside it should be block level OR floatThat should point you in the right direction.
November 10, 2016 at 5:10 am #247713solostParticipantAmazing restraint!
How you held back from saying, ‘learn to spell you dolt’ I’ve no idea.
That fixed it. Cheers!
-
AuthorPosts
- The forum ‘CSS’ is closed to new topics and replies.