burgeamon
09-24-2007, 01:44 PM
Hi guys, im fairly new to CSS so if i've made an errors then please let me know.
Im creating a simply layout that will have a header, 2 columns then a footer.
The issue im having is in IE where the margins don't seem to be correct. The page looks fine in Netscape but in IE it seems to add a few pixels to the margins.
A screenshot showing the 2 pages can be found here...
http://i12.tinypic.com/63ra63m.jpg
Here's the HTML.
<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Untitled Document</title>
<link href="default.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="wrapper">
<div id="header">
<div id="headerlogo">
<img src="images/motlive_logo.jpg" alt="MOTlive logo" width="280" height="46" />
</div>
<div id="headermenu">
<img src="images/menu.jpg" alt="menu test" width="389" height="19" /> </div>
</div>
<div id="content">
<div id="leftcol">
<h1>content</h1>
Lorem ipsum dolor sit amet,
consectetuer adipiscing elit.
Phasellus varius eleifend.
Donec euismod.
Praesent mauris mi, adipiscing non,
mollis eget, adipiscing ac, erat.
Integer nonummy mauris sit.
</div>
<div id="rightcol">
<h1>sidebar
<BR /></h1>
</div>
</div>
<div id="footer">
footer
</div>
</div>
</body>
</html>
and here is the CSS.
/* REMOVE DEFAULTS */
body,div,dl,dt,dd,h1,h2,h3,h4,h5,h6,pre,form,fieldset,input,textarea,p,blockquote,th,td{margin:0px;padding:0px;}
/* END REMOVE DEFAULTS */
#wrapper {
width:996px;
}
#content {
clear:both;
width:994px;
border: 1px solid #CCCCCC;
margin-top:4px;
padding-bottom:4px;
height:200px;
}
#header {
border-bottom-width: 1px;
border-bottom-style: solid;
border-bottom-color: #CCCCCC;
height:50px;
margin:0px;
display:block;
}
#leftcol {
width: 691px;
float: left;
background-color:#ffffff;
border: 1px solid #CCCCCC;
margin-left:4px;
margin-top:4px;
margin-bottom:4px;
margin-right:4px;
}
#rightcol {
width: 287px;
float: right;
background-color:#ffffff;
border: 1px solid #CCCCCC;
margin-top:4px;
margin-bottom:4px;
margin-right:4px;
}
#footer {
background: #d7dabd;
clear: both;
height:44px;
}
#headerlogo {
width:308px;
float:left;
}
#headermenu {
float:left;
width:389px;
position:relative;
top:31px;
}
Thanks,
Andy
Im creating a simply layout that will have a header, 2 columns then a footer.
The issue im having is in IE where the margins don't seem to be correct. The page looks fine in Netscape but in IE it seems to add a few pixels to the margins.
A screenshot showing the 2 pages can be found here...
http://i12.tinypic.com/63ra63m.jpg
Here's the HTML.
<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Untitled Document</title>
<link href="default.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="wrapper">
<div id="header">
<div id="headerlogo">
<img src="images/motlive_logo.jpg" alt="MOTlive logo" width="280" height="46" />
</div>
<div id="headermenu">
<img src="images/menu.jpg" alt="menu test" width="389" height="19" /> </div>
</div>
<div id="content">
<div id="leftcol">
<h1>content</h1>
Lorem ipsum dolor sit amet,
consectetuer adipiscing elit.
Phasellus varius eleifend.
Donec euismod.
Praesent mauris mi, adipiscing non,
mollis eget, adipiscing ac, erat.
Integer nonummy mauris sit.
</div>
<div id="rightcol">
<h1>sidebar
<BR /></h1>
</div>
</div>
<div id="footer">
footer
</div>
</div>
</body>
</html>
and here is the CSS.
/* REMOVE DEFAULTS */
body,div,dl,dt,dd,h1,h2,h3,h4,h5,h6,pre,form,fieldset,input,textarea,p,blockquote,th,td{margin:0px;padding:0px;}
/* END REMOVE DEFAULTS */
#wrapper {
width:996px;
}
#content {
clear:both;
width:994px;
border: 1px solid #CCCCCC;
margin-top:4px;
padding-bottom:4px;
height:200px;
}
#header {
border-bottom-width: 1px;
border-bottom-style: solid;
border-bottom-color: #CCCCCC;
height:50px;
margin:0px;
display:block;
}
#leftcol {
width: 691px;
float: left;
background-color:#ffffff;
border: 1px solid #CCCCCC;
margin-left:4px;
margin-top:4px;
margin-bottom:4px;
margin-right:4px;
}
#rightcol {
width: 287px;
float: right;
background-color:#ffffff;
border: 1px solid #CCCCCC;
margin-top:4px;
margin-bottom:4px;
margin-right:4px;
}
#footer {
background: #d7dabd;
clear: both;
height:44px;
}
#headerlogo {
width:308px;
float:left;
}
#headermenu {
float:left;
width:389px;
position:relative;
top:31px;
}
Thanks,
Andy