<div> <div></div> </div> 

How to make the inner div be in the center of the parent? Both units have a fixed width and height. Is it possible to make this design rubber?

    1 answer 1

     <style> #outer { width: 50%; background: yellow; position: relative; height: 200px; } #inner { width: 50%; background: blue; position: absolute; top: 25%; left: 25%; height: 100px; } </style> <div id="outer"> <div id="inner"></div> </div> 

    http://jsfiddle.net/9Sqb3/