3 replies [Last post]
cedtech23
Offline
newbie
Last seen: 15 years 39 weeks ago
Joined: 2004-08-14
Posts: 4
Points: 0

I need to align the right column on the right side and the left column on the right side.

I am a newbie. so please keep it as simple as possible

here is the code below

<html>
<head>
<title>Two Column CSS Layout</title>
<style type="text/css">

#main {
background:white;
}

#header {
background-color:#ddd;
}

#nav {
background-color:#c99;
}

#rightcolumn {
background-color:#9c9;
}

#leftcolumn {
background-color:#ccc;;
}

</style>
</head>
<body>

<div id="main">
<div id="header"><h1>This is the header for your banner</h1></div>
<div id="nav"><h3>This is the NAV for your links</h1></div>
<div id="rightcolumn">This is the right column</div>
<div id="leftcolumn">This is the left column</div>

</div>

</body>
</html>

cedtech23
Offline
newbie
Last seen: 15 years 39 weeks ago
Joined: 2004-08-14
Posts: 4
Points: 0

align column right and left

Here is the solution to the problem I had which was to center a box
that contained two columns that need to be aligned next to each other

#centerblock {
background:white;
position:absolute;
left:50%;
width:900px;
margin-top: 50px;
margin-left:-450px;
border-style: dashed;
}

#nav {
background-color:#c99;
width:100%;
}
#leftcolumn {
float: left;
left: 0%;
top: 10%;
width: 50%;
background-color:red;
}

#rightcolumn {
background: yellow;
margin: 0;
}

simple but took this newbie 3 hours to finally understand Shock

tommuir
Offline
Regular
Upper east side
Last seen: 15 years 51 weeks ago
Upper east side
Joined: 2004-04-05
Posts: 40
Points: 0

align column right and left

I use{
margin-left: auto;
margin-right:auto;
}
To center stuff.

i am not here

cedtech23
Offline
newbie
Last seen: 15 years 39 weeks ago
Joined: 2004-08-14
Posts: 4
Points: 0

align column right and left

I thought about that and then I saw this article

http://bluerobot.com/web/css/center1.html