Log in

View Full Version : how to position anything on a page without it moving in different resolutions ?



wecandoit
10-18-2014, 11:01 AM
<div style="position: absolute; left: 465px; top: 485px; width: 305px;">
this text
</div>


If I view this in a different resolution it is no longer in the same spot on the page. For example I work in 1920x1080 resolution and if I view the page in 1600x900 then the text will be moved off to the right.

How do you position something on a page and make it stay in the exact same spot in all resolutions?

molendijk
10-18-2014, 11:18 AM
Use percentages instead of pixels, ex. style="position: absolute; left: 20%; top: 15%; width: 40%;"