Hi Rich,
Welcome to CF! What you have is a good start. A few suggestions:
1. Don't test with IE. IE is not standards-compliant when it comes to rendering pages, so what you see with IE isn't a correct representation of your code, even if it looks right. Around here we say "Code it for Firefox, tweak (or hack) it for IE."
2.
The first step toward cross-browser compatibility is a DOCTYPE. It tells the browser which "rules" your page is playing by, and the browser renders the page accordingly. If the browser doesn't know
your rules, it's going to render the page by
its rules, which vary more from browser to browser.
That said, have a go with this:
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>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<title>Page Title Goes Here</title>
<style type="text/css">
body {
color: black;
background: white;
}
.BodyContainer {
width: 900px;
background-color: red;
overflow:auto;
}
.LeftContainer {
width: 150px;
float:left;
background-color: lightblue;
}
.MiddleContainer {
width: 550px;
float:left;
background-color: lightgreen;
}
.RightContainer {
width: 200px;
float:left;
background-color: tan;
}
.LeftContent {
color: red;
}
.MiddleContent {
color: orange;
}
.RightContent {
color: white;
}
</style>
</head>
<body>
<div class="BodyContainer">
<div class="LeftContainer">
<p class="LeftContent">
Text here
</p>
</div>
<div class="MiddleContainer">
<p class="MiddleContent">
Middle
</p>
</div>
<div class="RightContainer">
<p class="RightContent">
Right
</p>
</div>
</div>
</body>
</html>
Notice a few things:
1. Replaced some extraneous divs with <p>s in order to make the code
more semantic and avoid
divitis. Removed your line breaks too. If you want to add dummy content use
the lorem ipsum generator.
2. Your containers are floated left now instead of being set to
display:inline.
That's not a proper use of that declaration.
3.
overflow:auto has been added to .BodyContainer in order to
clear your floats.