How to center div inside another div horizontally using CSS
CSS margin property with an auto value needs to be used, but the inner tag div must have at least some width.
CSS:
#inner { margin: 0 auto; width: 200px; }
HTML:
<div class="outer"> <div class="inner">Text text text</div> </div>