View Full Version : Blogs appearing at same position


Chris
05-22-2006, 11:48 AM
http://www.silenceiseasy.com

In my index.php page, where the code to display each blog appears, I have a div id "main" which is for the main part on the left. It has an absolute position.

How do I get it so that each individual blog doesn't go to that absolute position, and therefore does not overlap other blogs.

Thanks,
Chris :D

Wermaus
05-22-2006, 12:20 PM
Hi!

You used #main{
width: 560px;
position: absolute;
top: 350px;
left: 50px;
}
to position the main-container absolute.
But you use the main-container a lot of times!
#main is an id - an id should not be used more than once on every page.
If you need to make reusable containers, use a class.
Your <div id="main"> are bound to appear on the same place if they all have the same absolute position.
You told them all to go 350px from the top and 50px from the left.

Chris
05-22-2006, 12:41 PM
I know why it does it, but I don't know how to find a way around it.

Wermaus
05-22-2006, 01:16 PM
So just don't use <div id="main"> for every single blog!
Create new container-ids with different top/left values and use them for the other blogs.
say:
#main2{
position:absolute;
top:800px;
left:50px;
}
#main3{
position:absolute;
top:1000px;
left:50px;


and so on...
But it would be better not to position them absolute - it makes trouble as you can see.
better change the main-ids to main-classes )class="main" instead of id=" main"( and try this without absolute positioning:

.main{
width: 560px;
margin-top:150px;
margin-left: 50px;
}

Chris
05-22-2006, 01:37 PM
Thanks! It worked :D