开发者

Position a div on the same display-position at any resolution?

开发者 https://www.devze.com 2022-12-12 19:27 出处:网络
For example I have a 10\" display. This display has either a resolution of 640x480 or 800x600. How can I position a div always at the same display-po开发者_JAVA百科sition (for example 5cm from the to

For example I have a 10" display. This display has either a resolution of 640x480 or 800x600.

How can I position a div always at the same display-po开发者_JAVA百科sition (for example 5cm from the top) regardless of which resolution is enabled?

This doesn't work, does it?

top: 5cm


Use percentages.

top: 10%;

will position the div at the same place on any display regardless of resolution as long as the physical dimensions of the displays are the same.

0

精彩评论

暂无评论...
验证码 换一张
取 消