Click to See Complete Forum and Search --> : Divs with 2 columns?


googlebot
04-18-2009, 02:35 PM
Hi, I need to make a site with a layout that has 2 columns and a few rows. I have been trying for hours to get it to work but the right column divs won't align to the right of the left column divs. I would appreciate any advice.

A drawing of the layout of the site can be seen here:
lifelineinsurance.net/layout.jpg

Thanks in advance.

aj_nsc
04-18-2009, 03:26 PM
What does your HTML and CSS look like so far?

googlebot
04-18-2009, 03:56 PM
<!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>Total Access Garage Doors</title>
<link href="styles/mainstyles.css" rel="stylesheet" type="text/css" />
</head>

<body>
<div id="wrapper">
<div id="right">
<div id="header"></div>
<div id="textcontent"></div>
<div id="imagecontent"></div>
</div>
<div id="left"> <div id="menu"></div></div>
<div id="footer"></div>
</div>
</body>
</html>



@charset "UTF-8";
body {
background-color: #DBE0E4;
text-align: center;
}
#wrapper {
width: 900px;
height: 500px;
margin-top: 20px;
margin-right: auto;
margin-bottom: 20px;
margin-left: auto;
border: 1px solid #000;
}
#right {
height: 100px;
width: 525px;
position: relative;
top: 0px;
right: 0px;
float: right;
margin-right: 0px;
margin-top: 0px;
}
#menu {
background-color: #000;
height: 100%;
width: 275px;
background-image: url(../images/totalaccess.jpg);
background-repeat: no-repeat;
background-position: 40px 20px;
}
#header {
background-color: #2A3A43;
background-image: url(../images/truckheader.png);
background-repeat: no-repeat;
background-position: right center;
height: 98px;
width: 525px;

}
#textcontent {
padding: 5px;
width: 515px;
height: 30px;
background-color: #006;
}
#left {
height: 100%;
width: 275px;
position: relative;
left: 0px;
top: 0px;
clear: right;
margin-top: 0px;
margin-left: 0px;
}

JeffMvr
04-18-2009, 09:51 PM
Try floating your left column, to the left (obviously).

Also, clear the floats all at once.