/* margin auto does the magic, make sure to provide width less than 100% */
.center {
margin: auto;
width: 400px;
}
.center {
margin: auto;
width: 50%;
}
.inner{
margin: 0 auto;
}
.row {
width: 100%;
text-align: center; // center the content of the container
}
.block {
width: 100px;
display: inline-block; // display inline with ability to provide width/height
}
<div class="center">this content will be in the horizontally centered of your page</div>
<style>
/** this is the css to center a DIV or any element **/
.center {
display: table;
margin: 0 auto;
}
</style>