By 03/02/2016 11 Comments

Horizontally center a div within another div using css

  • By applying following CSS example you can achieve this.

Example:

  • Of course, you don’t have to set the width to 50%. Any width less than the containing div will work. The margin: 0 auto is what does the actual centering.
  • If you are targeting IE8+, it might be better to have the following example:

Example

<style>
#inner {
 display: table;
 margin: 0 auto;
}
</style>
<div id="outer" style="width: 100%;">
<div id="inner">I am inner div in center</div>
</div>






Posted in: CSS, HTML, Solutions

Leave your valuable Comment

Have a natural attraction for women cosmetics and replica watches uk clothes, no
more than two for men the most attractive one, is to make their own driving experience, happy and can serve as the facade of the car, another is to highlight the taste edify sentiment rolex replica watch. The replica rolex is undoubtedly the most fashionable accessories, wear a suit to attend the activities, but also get a decent match on the replica watches .