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