My div changes position if i change the page resolution!!!

liunx

Guest
Dear all
I'm working on a site, where i should show different images of the same project, i decided to put all the images in the same page in different <span> with an absolute position, so by clicking on the number in the left side; the surfer will see in the right box each time a different image.

The problem is when i change resolution or if the page opens in a smaller window; all the divs changes their positions, how can i avoid this?

Please HeeeeelpI moved this to the CSS forum because it's really not a DHTML issue. The answer should be, don't use absolute positioning, use relative.first <span> position is not recognised in all browsers so best not to use it for this purpose.

you can set the position by style= in the image tag.

if this is set by default or intention to 'relative' then their position will change as the window size changes.

Place them outside other positioned elements and setting style="position:absolute;top:*whereeveryouwantit*px;left:*whereeveryouwantit*px;" will ensure that their position will be fixed irrespective of the window size.But that can get you into trouble with other page elements. For example, the img and font sizes. You can set img size to a % but do to that with a font requires JS. You can run into a lotta trouble at different res. using absolute positioning.each to thier own

but if is to stay in the same position ie 400px from the top and 300px from the left that is absolute positioning!
 
Back
Top