Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!


Is it possible to center a div inside a div horizontally?

danielm77danielm77 USAMember Posts: 72

I need to center a div horizontally which is inside another div. Please show me how to do it.



  • DavidMDavidM USAMember Posts: 342
    edited January 2014

    Assume your div setup as follows.

    <div id="outerDiv" style="width:100%">  
        <div id="innerDiv">Some Content</div>

    Add CSS as follows.
    #inner { display: table; margin: 0 auto; }

Sign In or Register to comment.