I’m having trouble understanding what I’m doing wrong.
In <div id=“left”> I need to place a few boxes that sit underneath each other.
So fare I have set <div id=“box1”> position to relative and added left: 104px and top: 108px placement. This box is now sitting exactly where I want it.
Now I’d like to add another box beneath called <div id=“box2”>. I’ve given it a height, width and set the position to relative, but the box doesn’t position in the top left corner of <div id=“left”>
Why is this so?
<!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></title>
<style type="text/css">
body {
margin: 0px;
padding: 0px;
}
#wrapper {
height: 780px;
width: 850px;
margin:0px auto;
}
#left {
height: 780px;
width: 363px;
float: left;
background-color: #666;
position: relative;
margin: 0px;
padding: 0px;
}
#right {
height: 780px;
width: 487px;
float: left;
background-color: #999;
position: relative;
}
#slideshow_container {
height: 567px;
width: 388px;
position: relative;
left: 0px;
top: 108px;
background-color: #e2e3e4;
}
#slideshow {
height: 548px;
width: 369px;
position: relative;
left: 9px;
top: 8px;
background-color: #FFF;
}
#box1 {
position: relative;
height: 82px;
width: 251px;
left: 104px;
top: 108px;
background-color: #e2e3e4;
}
#box2 {
height: 150px;
width: 251px;
background-color: #F00;
position: relativ;
}
</style>
</head>
<body>
<div id="wrapper">
<div id="left">
<div id="box1">BOX1</div>
<div id="box2">BOX2</div>
</div>
<div id="right">
<div id="slideshow_container">
<div id="slideshow"></div>
</div>
</div>
</div>
</body>
</html>