views:

149

answers:

1

I've got question related to center the page using div#container Typically the container code is like this:

div#container
{
margin-left: auto;
margin-right: auto;
width: 50em;
}

The container div tag wrap the part of the code that I would like to align center inside it.

For example we have 2 object A and object B _object A is position Absolute _Object B is position Relative

Both Object A and B are wrapped inside container

Problem: only object B (position relative) is align center The object A (absolute position) is not align center

So, how to center the things that are positioned already as absolute? Thank you for any explaination

+1  A: 

Try setting position:relative on the #container div. Position:absolute will otherwise be absolute on the window not the div.

Johan Leino