HTML5 horizontal alignment

An inline element can be centered using the text-align: center style on the parent element like in the following example:

<div id="containersharing" style="text-align: center">
<h1>Share or bookmark this page</h1>
<!-- AddThis code START -->
<!-- Go to www.addthis.com/dashboard to customize your tools -->
<div class="addthis_sharing_toolbox" style="display: inline-block;"></div>
<!-- AddThis code END -->
</div>

A block element can be horizontally centered using the following class selector:

.containerfootertext {
    width: 50%;
    margin: 0 auto;
    overflow: hidden;
}
Advertisements

Author: lucamauri

First and foremost a geek and a Trekker, Luca Mauri is employed as an IT Manager. A Space Exploration enthusiast, avid reader and hobbyist photographer.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

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

Google photo

You are commenting using your Google 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 )

Connecting to %s