/    Sign up×
Community /Pin to ProfileBookmark

Divs with 2 columns?

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.

to post a comment
CSS

3 Comments(s)

Copy linkTweet thisAlerts:
@aj_nscApr 18.2009 — What does your HTML and CSS look like so far?
Copy linkTweet thisAlerts:
@googlebotauthorApr 18.2009 — [code=html]
<!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>
[/code]


[CODE]
@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&#37;;
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;
}
[/CODE]
Copy linkTweet thisAlerts:
@JeffMvrApr 19.2009 — Try floating your left column, to the left (obviously).

Also, clear the floats all at once.
×

Success!

Help @googlebot spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 6.2,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,
)...