relative positioning with CSS

T

Tom

Hi
I have a 2 column layout - white on one side and grey on the other.
I want to insert 2 further columns into the grey side as nested divs.
Is the positioning of the div relative to the div that it is nested within,
or to the page itself
For an example of what I am trying to achieve:
www.irishmx.com/demo.gif
Any thoughts welcomed
Thanks
T
 
M

m

Tom said:
Hi
I have a 2 column layout - white on one side and grey on the other.
I want to insert 2 further columns into the grey side as nested divs.
Is the positioning of the div relative to the div that it is nested within,
or to the page itself
For an example of what I am trying to achieve:
www.irishmx.com/demo.gif
Any thoughts welcomed
Thanks
T
The position of any object on your page, not just <divs> is
relative to the immediate containing element. The nesting can
be carried as deep as your visitor's sanity allows.
 
T

Toby A Inkster

Tom said:
Is the positioning of the div relative to the div that it is nested within,
or to the page itself

The position of a relatively positioned element is relative to where it
would have been placed if you didn't try to fiddle with its position.

OTOH, absolutely positioned elements are positioned relative to the top
left corner of their nearest non-statically positioned ancestor.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,768
Messages
2,569,575
Members
45,053
Latest member
billing-software

Latest Threads

Top