October 15, 2001 - Out-of-Window Positioning
October 15, 2001|
Tips: October 2001
Yehuda Shiran, Ph.D.
styleobject's position property can have three values:
"relative". One obvious difference between
absolutepositioning is in the way out-of-window situation is handled. When you use
absolutepositioning and your object gets placed outside the current window, a scroll bar will appear (or extend) in the proper direction, to allow its viewing. When you use
relativepositioning, on the other hand, and your object gets placed outside the current window, you won't be able to see the object. Scroll bars won't be created or extended to include the object in the viewable area. 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 We set
1700so it won't be included in your current window. When you ask for
relativepositioning, the yellow paragraph won't be visible. When you ask for absolute positioning, the yellow paragraph will be shown, by extending (or creating) the vertical scroll bar.
Here is the code: