...

View Full Version : Center Align heading



squirellplaying
07-12-2005, 02:51 AM
I'm trying to align the header of my page. It works in IE, but can't get it to work in firefox(I know it's backwards and it pains my soul).


<div style="width:100%; text-align:center">
<div style="width:800px; height:127px; background-color:#003399;">
Test
</div>
<div style="width:800px; height:26px; background-color:#6698cb;">
Test
</div>
</div>


I want the two inner divs centered on the page. I tried using margins and padding but doesn't work for different resolutions. If it works at 1152 864, it doesn't work at 800x600. Idears?

harbingerOTV
07-12-2005, 04:12 AM
<div style="width:100%; text-align:center;">
<div style="width:800px; height:127px; background-color:#003399;margin: 0 auto">
Test
</div>
<div style="width:800px; height:26px; background-color:#6698cb;margin: 0 auto">
Test
</div>
</div>


IE uses the text-align property on anything. FF needs the margin: 0 auto 0 auto (margin: 0 auto) to make it appear correctly as it text-aligns only text...go figure ;).



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum