benzoenator
09-07-2010, 01:57 AM
Hi guys,
First time poster, long time lurker.
I'm a complete novice when it comes to CSS, so I apologise if I've made a stupid mistake.
I'm trying to get a simple 2 column layout working - left hand column being navigation and right hand side being the content. I'm that the content div is going underneath the navigation div. When I do stretch the window out, it comes right, but if possible I'd like the two divs to remain to on the same line no matter what the size of the page. I've googled around for an hour and tried a whole bunch of things to no avail. I'm hoping I've made a stupid mistake, but if someone could take a look over my code, I'd be extremely appreciative :)
<!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=UTF-8" />
<title>Untitled Document</title>
<style type="text/css">
<!--
body {
background-color:#A5A5A5;
}
.container {
margin: 0 auto;
width:90%;
}
.navigation {
float: left;
clear: left;
margin-right: 30px;
}
.menuarea {
border: 1px solid black;
width: 200px;
}
.menuheading {
background-color:#069;
border-bottom: 1px solid black;
font-size:14px;
font-family: Verdana, Geneva, sans-serif;
font-weight: bold;
color: white;
padding:2px;
}
.content {
float:left;
clear: right;
width:80%;
border: 1px solid black;
}
.contentheading {
padding:2px;
background-color:#069;
border-bottom: 1px solid black;
font-size:14px;
font-family: Verdana, Geneva, sans-serif;
font-weight: bold;
color: white;
}
-->
</style></head>
<body>
<div align="center">{IMAGE}</div>
<br />
<div class="container">
<div class="navigation">
<div class="menuarea">
<div class="menuheading">{MENU TITLE}</div>
{MENU CONTENT}
</div>
</div>
<div class="content">
<div class="contentheading">{CONTENT TITLE}</div>
{CONTENT}
</div>
</body>
</html>
First time poster, long time lurker.
I'm a complete novice when it comes to CSS, so I apologise if I've made a stupid mistake.
I'm trying to get a simple 2 column layout working - left hand column being navigation and right hand side being the content. I'm that the content div is going underneath the navigation div. When I do stretch the window out, it comes right, but if possible I'd like the two divs to remain to on the same line no matter what the size of the page. I've googled around for an hour and tried a whole bunch of things to no avail. I'm hoping I've made a stupid mistake, but if someone could take a look over my code, I'd be extremely appreciative :)
<!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=UTF-8" />
<title>Untitled Document</title>
<style type="text/css">
<!--
body {
background-color:#A5A5A5;
}
.container {
margin: 0 auto;
width:90%;
}
.navigation {
float: left;
clear: left;
margin-right: 30px;
}
.menuarea {
border: 1px solid black;
width: 200px;
}
.menuheading {
background-color:#069;
border-bottom: 1px solid black;
font-size:14px;
font-family: Verdana, Geneva, sans-serif;
font-weight: bold;
color: white;
padding:2px;
}
.content {
float:left;
clear: right;
width:80%;
border: 1px solid black;
}
.contentheading {
padding:2px;
background-color:#069;
border-bottom: 1px solid black;
font-size:14px;
font-family: Verdana, Geneva, sans-serif;
font-weight: bold;
color: white;
}
-->
</style></head>
<body>
<div align="center">{IMAGE}</div>
<br />
<div class="container">
<div class="navigation">
<div class="menuarea">
<div class="menuheading">{MENU TITLE}</div>
{MENU CONTENT}
</div>
</div>
<div class="content">
<div class="contentheading">{CONTENT TITLE}</div>
{CONTENT}
</div>
</body>
</html>