开发者

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

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜