Centering Divs within a Div

Simple Code:

<div class='yuzo_related_post'>

		<div class='yuzo_wraps'>
			
			<div class="relatedthumb " style="width:215px;float:left;overflow:hidden;">  
			 </div>

			 <div class="relatedthumb " style="width:215px;float:left;overflow:hidden;">  
			 </div>

			 <div class="relatedthumb " style="width:215px;float:left;overflow:hidden;">  
			 </div>

		</div>
		
</div>

I want these inner divs to be centered within the parent div… But this always seems to confuse me…

Based on the snippit posted, don’t float the inner divs.
Since they have a fixed width assigned, {margin:0 auto} should center them.
They probably don’t need {overflow:hidden} unless they contain floating content.

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.