or of course, what ever top and bottom margin you want..i just put those zeroes there as placeholders...
also, to warn you, there are some old browsers (IE5/Mac?) that don't center like this correctly. However, as a work around, you can use 'text-align: center' on the parent div and then 'text-align:left' on the div iteslf...
(X)HTML
<div class="wrapperbox">
<div class="centeredbox">
non-centered text
</div>
</div>
CSS
.wrapperbox { text align: center;}
.centeredbox {margin: auto; text-align:left;}
Main Topics
Browse All Topics





by: FendrinPosted on 2003-11-04 at 11:01:36ID: 9680892
set margin-left and margin-right to auto
margin: 0 auto 0 auto;