Forum Moderators: not2easy
css
*****************************
#content {
padding: 10px;
font-size: 12px;
background-color: #fff; }
*****************************
html
*****************************
<div id="content">text goes here</div>
when this gets displayed in IE there is 20px padding top. I tried to fix it via the double margin bug, but this is not the problem.
css
*****************************
#content {
font-size: 12px;
background-color: #fff; }
.contenttext {
padding: 10px; }
*****************************
html
*****************************
<div id="content"><p class="contenttext">text goes here</p></div>
--------------------------------
When adding padding in IE onto a div it will increase the height \ width by the amount of padding you have added, when working with specific heights \ widths you can get round this by deducting the amount of padding from the size of the div.
But the above should work spot on.
When adding padding in IE onto a div it will increase the height \ width by the amount of padding you have added...
As it should do, in all standards compliant browsers (FF etc.), using a correct DOCTYPE.
But, like Ingolemo suggests, the code given in the first post is OK in itself - it renders correctly in FF, IE6 (with or without a DOCTYPE) - so the problem is possibly its interaction with other elements.