Forum Moderators: not2easy
.center-banner {
border-color:#3A3B43;
/**/
color:#FFFFFF;
background-color:#1C2023;
border-width: 1px;
border-style:solid;
padding:.7em;
margin-bottom:5px;
font-size:10pt;
height:90px;
.center-widget {
border-color:#3A3B43;
color:#FFFFFF;
background-color:#1C2023;
border-width: 1px;
border-style:solid;
padding:1em;
margin-bottom:5px;
font-size:10pt;
}
Any help appreciated!
* {
margin: 0;
padding: 0;
}
This will set all elements to zero. The down side is, it will set all elements to zero so you will have to define these attributes for each element.
One thing I have noticed, it is usually the <p> or <h> that throws everything off in my layouts, not the <div>.
Marshall
(Only with the Traditional Box Model - IE (quirks mode) - would the overall height be 90px)
The height property in CSS (according to the standards) refers to just the height of the content area, on top of this goes padding, border and margins. So the overall height of your container is:
90px + 5px + (2 * 0.7em) + (2 * 1px) = 97px + 1.4em
(height + margin-bottom + padding + border)
Are all browsers obeying the W3C Box Model? How are browsers treating the 0.7em? (A relative dimension based on the font-size of the parent.) Certainly with a mix of (none px) units I can see problems in trying to get it pixel perfect cross-browser.
Certainly with a mix of (none px) units I can see problems in trying to get it pixel perfect cross-browser.
I tried using all pixels instead and that churned out even more unpredictable results, which really surprised me, so I just went back to using the "0.7em" There seems to be no rhyme or reason to the differences between browsers, but the good thing is all the blocks are still cleared of each other, despite being a few pixels off, so I'm just going to leave it alone and count my blessings.
...the good thing is all the blocks are still cleared of each other, despite being a few pixels off, so I'm just going to leave it alone and count my blessings.
To be honest, that's what I aim for. IMO HTML + CSS was never intended to create pixel perfect layouts (although it can be done to a certain extent with CSS and the situation is getting better). Afterall HTML is a markup language, not a page layout language, intended primarily for the sharing of information.