I'm trying to horizontally center a block element on a page.
Here is an example of what I want:

I cannot use div hard sizing because layout should be responsive.
http://fiddle.jshell.net/rdy9nmp0/
Here is the code:
<div class = "container"> <div class="sub"> <h1> 01</h1> <div class = "icon"><img src="img/settings.png" alt=""> <h2> Power Inside</h2> <p>Cum sociis natoque penatibus et magnis dis parturient montesmus. Pro vel nibh et elit mollis commodo et nec augueique</p> <a class="iconlink" href="/">Read more</a> </div> </div> <div> CSS
.container { width: 1160px; overflow: hidden; display: inline-flex; margin: 0 auto; } .sub{ padding-top: 30px; padding-bottom: 30px; padding-right: 30px; padding-left: 30px; display: inline-block; vertical-align: top; } .sub h1{ font-size: 90px; color: #efeff0; font-family: 'Ubuntu', sans-serif; padding: 0px; float:left; } .sub img { padding: 10px 0px 10px 0px; } .sub h2 { color: #2a2b2e; font-size: 20px; font-family: 'Ubuntu', sans-serif; } .sub p { color: #8a8a8a; font-size: 13px; font-family: 'Arial', sans-serif; } .sub .icon{ overflow: hidden; padding-left:20px; } .sub .iconlink{ font-size: 13px; color: #2a2b2e; height: 28px; -moz-border-radius: 50px; -webkit-border-radius: 50px; border-radius: 50px; text-decoration: none; vertical-align:baseline; font-weight: bold; font-family: 'Ubuntu', sans-serif; background: url(../img/shape_blue.png) no-repeat scroll right center #fff; padding: 0 20px 0 0; background-position: right; } .container .iconlink:hover, .iconlink:hover { color: #248cec; background: url(../img/shape_grey.png) no-repeat scroll right center #fff; text-decoration: none; vertical-align:baseline; background-position: right; } .container .iconlink a:active { color: #248cec; } img { display:inline-block; }