Menu
i have a div id of mainhome
now I want all the other divs of the page to be positioned according to that div
now i’m doing for example
.linkguest{
position: relative;
right: 31;
top: 218;
}
but this is not working — i want it to be in that exact position relative to mainhome
what am I doing wrong?
<html>
<head>
<style type="text/css">
#container {position:relative; width: 500px; height:395px; border:1px solid #000; background:#000; }
.card1, .card2, .card3, .card4, .card5 {position: absolute; background:#454545; border:1px solid #fff; width:150px; padding:3px; height:250px; color:#fff;}
.card1 {margin:120px 0 0 20px;}
.card2 {margin:95px 85px;}
.card3 {margin:70px 170px;}
.card4 {margin:45px 245px;}
.card5 {margin:20px 330px;}
</style>
</head>
<body>
<div id="container">
<h2 style="position:absolute; left:20px; top:10px; color:white;">Container Box</h2>
<h2 style="position:absolute; right:20px; bottom:10px; color:white;">Container Box</h2>
<div class="card1">
first card </div>
<div class="card2">
second card </div>
<div class="card3">
third card </div>
<div class="card4">
fourth card </div>
<div class="card5">
fifth card </div>
</div>
</body>
</html>[/QUOTE]
[code=html]
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"DTD/xhtml1-strict.dtd">
<html>
<head>
<title>d</title>
<style>
/* CSS Document */
body{
padding:0px;
}
#outer{
margin:auto;
width:750px;
}
#mainhome{
font-family: Arial, Helvetica, sans-serif;
background-image: url(images/home_page_background.jpg);
background-repeat: no-repeat;
background-position: right top;
width:750px;
height:1082px;
position:relative;
}
.linkguest{
position: relative;
right: 31;
top: 218;
}
.linkdonor{
position: absolute;
right: 31;
top: 319;
}
.linkparent{
position: absolute;
right: 31;
top: 426;
}
.linkcaregiver{
position: absolute;
right: 31;
top: 526;
}
#news{
position: absolute;
right: 151;
top: 319;
}
#news img{
float:right;
}
#newstb{
background:#ffffff;
width:472px;
height:249px;
overflow: auto;
position: absolute;
scrollbar-base-color:#FDC6CC;
text-align:right;
float:right;
}
</style>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
<div id=outer>
<div id=mainhome>
<div class=linkguest><img src="images/guest.gif" alt="Guest" width="103" height="101" border="0"></div>
<div class=linkdonor><img src="images/donor.gif" alt="Guest" width="106" height="109" border="0"></div>
<div class=linkparent><img src="images/parent.gif" alt="Guest" width="106" height="104" border="0"></div>
<div class=linkcaregiver><img src="images/caregiver.gif" alt="Guest" width="99" height="103" border="0"></div>
<div id=news> <img src="images/news.gif" width="229" height="37" border="0"><br>
<div id=newstb> this is dummy text <bR>
will be pulling form the db<br>
this is dummy text <bR>
will be pulling form the db<br>
this is dummy text <bR>
will be pulling form the db<br>
this is dummy text <bR>
will be pulling form the db<br>
this is dummy text <bR>
will be pulling form the db<br>
this is dummy text <bR>
will be pulling form the db<br>
this is dummy text <bR>
will be pulling form the db<br>
this is dummy text <bR>
will be pulling form the db<br>
this is dummy text <bR>
will be pulling form the db<br>
this is dummy text <bR>
will be pulling form the db<br>
this is dummy text <bR>
will be pulling form the db<br>
this is dummy text <bR>
will be pulling form the db<br>
this is dummy text <bR>
will be pulling form the db<br>
this is dummy text <bR>
will be pulling form the db<br>
</div>
</div>
</div>
</div>
</body>
</html>
[/code]
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"This will look the same for IE and Fx.
"[B]http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd [/B]">
<html xmlns="http://www.w3.org/1999/xhtml ">
<head>
<title>d</title>
<style type="text/css">
/* CSS Document */
* { padding:0px; margin:0; }
p {margin:14px 0 10px 0;}
#outer{ position:relative; margin:auto; width:750px;}
#mainhome{ position:relative; font-family: Arial, Helvetica, sans-serif; background-image: url(images/home_page_background.jpg); background-repeat: no-repeat; background-position: right top; width:750px; height:1082px; border:1px solid gray;}
.linkguest {float:right;}
.linkdonor {clear:right; float:right;}
.linkparent {clear:right;float:right;}
.linkcaregiver {clear:right;float:right}
#news {width:230px; margin:75px auto 0 auto; border:1px solid silver;}
#news p {margin:0;}
#news p img {width:230px; margin:0 auto;}
#newstb{ background:#ffffff; width:472px; height:249px; overflow: auto; position: relative; scrollbar-base-color:#FDC6CC; text-align:right; border:3px double silver; margin:0 auto; padding:25px 15px; }
</style>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
</head>
<body>
<div id="outer">
<div id="mainhome">
<div class="linkguest">
<img src="images/guest.gif" alt="Guest" width="103" height="101" border="0" />
</div>
<div class="linkdonor">
<img src="images/donor.gif" alt="Guest" width="106" height="109" border="0" />
</div>
<div class="linkparent">
<img src="images/parent.gif" alt="Guest" width="106" height="104" border="0" />
</div>
<div class="linkcaregiver">
<img src="images/caregiver.gif" alt="Guest" width="99" height="103" border="0" />
</div>
<div id="news">
<p><img alt="image over news content scrolling" src="images/news.gif" width="229" height="37" border="0" /></p>
</div>
<div id="newstb">
<h1 title="First-Level Header">First-Level Header</h1>
<p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit.
Suspendisse egestas ultricies pede. Phasellus suscipit blandit
risus. Praesent nonummy. In erat. Duis nibh pede, accumsan eu,
pulvinar et, volutpat vel, elit. <img alt="pic-1" src="#" style=
"width:60px; height:75px; border:1px solid black; margin:8px; float:left;" />
<img alt="pic-2" src="#" style=
"width:60px; height:75px; border:1px solid black; margin:8px; float:right;" />
Curabitur nec dui sed nunc congue tempus. Nulla ac dui ac libero
fringilla nonummy. Maecenas ullamcorper sodales risus. Vivamus
pretium dolor. Proin eu turpis. Phasellus ut mauris non nulla
mattis luctus. Nunc porttitor dapibus sapien. In malesuada
fermentum metus. Nulla egestas, tellus a vestibulum pharetra, nunc
purus auctor lacus, ut semper purus ipsum eu velit. Praesent dui.
Nulla accumsan turpis at erat.</p>
<h1 title="Second-Level Header">Second-Level Header</h1>
<p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Morbi
lacus felis, euismod at, pulvinar sit amet, dapibus eu, eros. Etiam
tellus. Nam vestibulum porttitor urna. Phasellus aliquet pretium
quam. Proin pharetra, wisi nec tristique accumsan, magna sapien
pulvinar purus, vel hendrerit ipsum tellus at ante.</p>
<p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Morbi
lacus felis, euismod at, pulvinar sit amet, dapibus eu, eros. Etiam
tellus. Nam vestibulum porttitor urna. Phasellus aliquet pretium
quam. Proin pharetra, wisi nec tristique accumsan, magna sapien
pulvinar purus, vel hendrerit ipsum tellus at ante.</p>
</div>
</div>
</div>
</body>
</html>[/QUOTE]
0.1.9 — BETA 5.20