Use a div container that is centered, then its contents you can give margin-left:npx - like this:
HTML
<div id="container"> <span id="green"> </span><br /> <span id="blue"> </span> </div>
CSS
#container{width:100px; margin:auto auto; background-color:red;} #container span{display:block; width:100%; } #green{background-color:green; margin-left:10px;} #blue{background-color:blue; margin-left:-10px;}
See an example encoded here - http://jsfiddle.net/Xpk8A/1/
source share