|
October 14, 2001 Positioning Demo Tips: October 2001
Yehuda Shiran, Ph.D.
|
|
The style object's position property can have three values: "static", "absolute", and "relative". It is not that trivial what the effect of each position parameter value is. Play around with the three links below and see their effect on the following layout:
This is a paragraph of text in a DIV.
This is a paragraph of text as well. Make it static | Make it absolute | Make it relative When you make itstatic, the yellow paragraph becomes the first element of the parent paragraph. There are no offsets to take care of, as they are not relevant for static positioning.
When you make it relative, the yellow paragraph is offset by
When you make it Here is the code:
People who read this tip also read these tips: Look for similar tips by subject: |