Jump to content

Centered isn't... centered


Recommended Posts

I have three images (header and two bars to frame my nav bar) centered using this code:

.main {	display: block;	margin-left: auto;	margin-right: auto;}

This looks fine, but when I center text using text-align, it's all slightly off center. I didn't notice until I fully set up my navbar and realized the text was farther to the right than "center." I fixed it by adjusting margin-right, but I want to know what caused the problem. (Especially since I'm having the same problem with the footer.)


Nav Bar Code:

#bar ul{	list-style: none;	text-align: center;	word-spacing: 150px;	margin-right: 40px;	}#bar li {	font-family: Helvetica, "Helvetica Neue", Gotham, Arial, sans-serif;	font-size: 20px;	display:inline;}
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Create New...