Thomas Owens Thomas Owens - 6 months ago 14
HTML Question

How do I align spans or divs horizontally?

My only problem is making them line up three-across and have equal spacing. Apparently, spans can not have width and divs (and spans with display:block) don't appear horizontally next to each other. Suggestions?

<div style='width:30%; text-align:center; float:left; clear:both;'>
Is what I have now.

Answer

You can use divs with the float: left; attribute which will make them appear horizontally next to each other, but then you may need to use clearing on the following elements to make sure they don't overlap.