Results 1 to 2 of 2
Jul 8, 2004, 06:23 #1
- Join Date
- Dec 2003
- Houston, Texas
- 0 Post(s)
- 0 Thread(s)
Positioning Question while waiting on answer
I'm still having problem understanding the relative and absolute positioning attributes. I have a book "Learn CSS in 24 Hours". Well it's been a lot longer than 24 hours and I'm still wrestling with the concept.
In the book it keeps referring to a "context box":
"The context box is determined by the value of the position property. If the value of the position is relative, the context box is the original position of the element. If the value of the position is absolute, the context box is the display box of the <body> tag."
What is the context box? The div I'm working on? The browser window? What and where am I measuring from to know what amount to enter?
Any insight would be great. This seems to be the most confusing part of CSS. When I read the above, I feel like it's a box within a box within a box within a box. Maybe it is maybe not. I don't know, my head is spinning trying to figure this out.
Jul 8, 2004, 06:33 #2
- Join Date
- Jan 2003
- Hampshire UK
- 128 Post(s)
- 3 Thread(s)
The context box is basically the parent of the element and a parent of a positioned element is defined in a special way as shown below.
There is a short explanation in the FAQ thread of which i've duplicated below:
Originally Posted by faq
A relatively placed element is moved from where it is and then put somewhere else. So left 10px would mean move me from where i am by 10 px to the left.
However the space that the relative object previously occupied is preserved and all other elements will react as if the elelement was still in its original position in the flow of the document.
Hope that explains it a bit clearer.