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.
精彩评论