The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums CSS why relative div position is not right? Re: why relative div position is not right?


I’m also not really sure what you’re trying to do, but here’s a few tips that may get you in the right direction.

Give the green box a top of 0 and left of 0, and you’ll see where it would end up without any specific positioning (in my case, top left). Then with adding values to top and left, you can position it better.

Give it float:left, like all the other blocks. That way, it’ll interact the same way as the other blocks do with eachother. If you don’t do that, the default placement is top left.

Instead of using position:relative, use margins to position the block where you want it.

Just a few suggestions you might want to look into!