I need to center a div horizontally which is inside another div. Please show me how to do it.
Assume your div setup as follows.
<div id="outerDiv" style="width:100%"> <div id="innerDiv">Some Content</div> </div>
Add CSS as follows.
#inner { display: table; margin: 0 auto; }
It looks like you're new here. If you want to get involved, click one of these buttons!
Comments
Assume your div setup as follows.
Add CSS as follows.