Vertical text alignment – Continue with Horizontal aligment!

for text element use

.style{text-align:center;}

for block element like <div> use

.style{

margin-left:auto;

margin-right:auto;

}

for more detail you can reference here.

If you are using vertical centering from my previous post Vertical text alignment – CSS _ and # hacks!

You will find yourself in trouble in IE as I do.

because I didn’t define the width of the inner elements!

just add width to the inner element same as the outer width.

and you are okay.

Advertisements

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s