Forum Moderators: not2easy
CSS:
div.container1
{
width:449px;
height:100px;
margin:0px;
padding:10px;
border:0;
background-color:#FF0000;
}
HTML:
<html>
<head>
<title>styletest</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link rel="stylesheet" href="styleb.css" type="text/css">
</head>
<body>
<div class="container1">hello</div>
</body>
</html>
Firefox seems to add the 10px padding to the width/height of the container.
Am I missing something?
Any help welcome
Prob is IE and FF render the box model differently. Add this to your stylesheet (with the comments):
/* IE style \*/
* html .container1
{
width:449px;
height:100px;
margin:0px;
padding:5px;
border:0;
background-color:#FF0000;
}
/* IE style */
Cant remember if IE is less or more, but i think IE adds padding to the width.
Basically you can set diff margins and padding for IE. Other way of fixing is make your margins and padding 0px. Hope that helps.
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
or
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
I am converting a pixel perfect hTML site into CSS and getting the content to stay the same has been a nightmare. I am sure I will be calling on your skills again soon, and hopefully, helping others with their problems if all goes well :S (can't wait till that day)
Cheers again
OJ