Right now I am only using IE 8. I don't understand why the following layout looks different between IE8 and other browsers whenever I apply a padding of 6px to one of the content columns.
What's the best fix for this situation?
- Conditional statements
- CSS hack or Javascript hack
- Should the columns be classes instead of divs?
- Errors in the CSS code?
Stylesheet:
Code:
#wrapper {
background-color: gray;
width: 760px;
margin:0 auto;
}
#header {
background-color: orange;
}
#container {
background-color: silver;
}
#mainCol {
background-color: #ffffff;
width: 560px;
float: left;
padding: 6px;
}
#rigCol{
background-color: #99cc00;
width: 200px;
float: right;
}
#footer {
background-color: #cc6600;
clear: both;
}
Website structure:
HTML Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>2 Column Layout Example</title>
<link rel="stylesheet" type="text/css" href="style.css" />
</head>
<body>
<div id="wrapper">
<div id="header">a</div>
<div id="container" class="clearfix">
<div id="mainCol">aaaaaaaaaaaaaa aaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaa a</div>
<div id="rigCol">a</div>
</div>
<div id="footer">a</div>
</div>
</body>
</html>
Thanks
Bookmarks