 <p>Try this working link at plnkr: <a href="http://plnkr.co/edit/OaQBWxlIfa2fVvanKKEl?p=preview" rel="nofollow">http://plnkr.co/edit/OaQBWxlIfa2fVvanKKEl?p=preview</a></p> <p>Hope it helps!!! HTML</p> <pre><code>&lt;div class="blockcontainer"&gt; &lt;div class="blockcenterbox"&gt; &lt;div class="blocktop"&gt;abc&lt;/div&gt; &lt;/div&gt; &lt;div class="blockbottom"&gt;&lt;/div&gt; &lt;/div&gt; </code></pre> <p>CSS</p> <pre><code>.blockcontainer { width:200px; height:200px; background-color:#00CC66; overflow:hidden; } .blocktop { width:100px; background-color:#6699FF; height:50px; } .blockcenterbox { width: 100px; height: 50px; background-color: yellow; margin: 0 auto; } .blockbottom { width:25px; height:25px; background-color:black; margin: 0 auto; } </code></pre>