Hi all.
I have just been using position:absolute to place images where I want to physically on the screen. It occurred to me what might happen if I was constructing a vertical list of image options which had more than the screen could allow.
That is, would a scroll bar appear if I defined position:absolute to be beyond the number of pixels on a page.
Using code such as:
<img ... position:absolute;top:20;left:10;...>
<img ... position:absolute;top:50;left:10;...>
............
............
............
<img ... position:absolute;top:x;left:10;...>
actually does work fine, with the scrollbar appearing immediately the value x exceeds the dimensions of the screen.
My questions are:
1. What are the dimensions, in terms of pixels, of a screen?
2. Can position:absolute be relied upon to work like this?
3. If it does, what purpose does position:relative serve?
Thanks in advance.
Russell.
I have just been using position:absolute to place images where I want to physically on the screen. It occurred to me what might happen if I was constructing a vertical list of image options which had more than the screen could allow.
That is, would a scroll bar appear if I defined position:absolute to be beyond the number of pixels on a page.
Using code such as:
<img ... position:absolute;top:20;left:10;...>
<img ... position:absolute;top:50;left:10;...>
............
............
............
<img ... position:absolute;top:x;left:10;...>
actually does work fine, with the scrollbar appearing immediately the value x exceeds the dimensions of the screen.
My questions are:
1. What are the dimensions, in terms of pixels, of a screen?
2. Can position:absolute be relied upon to work like this?
3. If it does, what purpose does position:relative serve?
Thanks in advance.
Russell.
Comment