PDA

View Full Version : CSS Style Align



dboers
October 13th, 2004, 08:11 AM
I have the following CSS style to control the layout of a html page:
body {
background-color: white;
background: url(images/bg.jpg) top center; background-repeat:repeat-y;
margin-top: 0pt;

scrollbar-face-color: #ffffff;
scrollbar-highlight-color: #cccccc;
scrollbar-shadow-color: #999999;
scrollbar-3dlight-color: #FFFFFF;
scrollbar-arrow-color: #999999;
scrollbar-track-color: #ffffff;
scrollbar-darkshadow-color: #666666;
}

In the HTML page I have one main table for all the other content. I want the table to align in the centre with a margin of 0pt on top. The margin of 0pt is working because of the margin-top code in my CSS style, but I don't know how to align the table horizontal in the centre within this body Style.

I want the alignment insite the body code, just like the background-image part.

How do I do that?

Thanks in advance

[m]
October 13th, 2004, 05:26 PM
body, html {
margin:0;
padding:0;

background-color: white;
background: url(images/bg.jpg) top center;
background-repeat:repeat-y;
/* stupid scrollbar colours only for IE */
scrollbar-face-color: #ffffff;
scrollbar-highlight-color: #cccccc;
scrollbar-shadow-color: #999999;
scrollbar-3dlight-color: #FFFFFF;
scrollbar-arrow-color: #999999;
scrollbar-track-color: #ffffff;
scrollbar-darkshadow-color: #666666;
}


.align-center {
margin: auto 0;
text-align:center; /* IE HACK */
}

.align-center * {
text-align: right; /* end IE HACK */
}



<table class="align-center"></table>