I have a content section in a div, and currently it is in the center on the left. Fiddle
I tried adding a container div like:
<div style='text-align:center; width:100px;'>[content]</div>
But no luck. Also tried this:
<div style='margin: 0px auto; width:100px;'>[content]</div>
Content is still left-aligned.
This works, but I would like to find the right way to do this using CSS:
<div style='width:100px;' align='center'>[content]</div>
Help was appreciated. I am tempted to do this with tables, but I need to break free from old habits!
html css centering
a coder
source share