Forum Moderators: not2easy

Message Too Old, No Replies

help with div

         

MarrkoR

7:17 pm on Aug 6, 2009 (gmt 0)

10+ Year Member



Hi,
i have 4 div and I want to do so:
<snip>
But i have trouble whit right div. It is below the second div.


<html>
<head>
<style type="text/css">
body {
margin:0;
margin-top: 0;
margin-bottom: 0;
text-align: center;
}
div.all{
width: 600px;
background-color: #5292d9;
}
div.left{
float: left;
width: 60px;
height: 500px;
background-color:#00ff00;
}
div.top{
float: left;
width: 460px;
height: 100px;
background-color:#223366;
}
div.center{
float: left;
width: 460px;
height: 400px;
background-color:#123d34;
}
div.right{
float: left;
width: 80px;
height: 500px;
background-color:#336699;
}
</style>
</head>
<body>
<div class = "all">
<div class = "left">1</div>
<div class = "top">2</div>
<div class = "center">3</div>
<div class = "right">4</div>
</div>
</body>
</html>

[edited by: swa66 at 7:35 pm (utc) on Aug. 6, 2009]
[edit reason] No links, please see ToS and forum charter [/edit]

birdbrain

10:58 am on Aug 7, 2009 (gmt 0)



Hi there MarrkoR,

try it like this...


<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html lang="en">
<head>

<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta name="language" content="english">
<meta http-equiv="Content-Style-Type" content="text/css">

<title></title>

<style type="text/css">
body {
margin:0;
text-align:center;
}

#all{
width:600px;
background-color:#5292d9;
}

#left{
float:left;
width:60px;
height:500px;
background-color:#0f0;
}

#middle {
float:left;
width:460px;
}

#top{
height:100px;
background-color:#236;
}

#center{
height:400px;
background-color:#123d34;
}

#right{
float:left;
width:80px;
height:500px;
background-color:#369;
}
</style>

</head>
<body>

<div id="all">

<div id= "left">1</div>

<div id="middle">
<div id="top">2</div>
<div id="center">3</div>
</div>

<div id="right">4</div>

</div>

</body>
</html>


birdbrain