I’m rewriting everything and moving away from absolute positions and instead using floats to position things the way I want them.
The question now is how can I float multiple divs on top of each other? The user will be able to switch between these divs somehow.
Thanks
Edit: The reason I’m moving away from absolute position is that I want my div to still be a child of its parent. i.e. if my div gets extended I want the parent div to get extended also.
float does not overlap with other floated objects in the same container. See here for an example of three successive floated objects to see how they don’t overlap.
If you want objects to overlap, you will want/need to use absolute positioning. You can use positioning relative to the parent object by setting the parent to
position:relative;and the child toposition: absolute;. See here for an example of overlaping objects with absolute positioning relative to the parent.If, you’re trying to only have one of these objects actually display at a time, then just set the non-displayed objects to
display: noneand they will take no space in the page layout. You won’t need to use float or absolute positioning.