edA-qa mort-ora-y
edA-qa mort-ora-y

Reputation: 31871

Get the device's real display size/DPI

Is there some way to get the real screen-size or DPI of the device? I have certain elements in my application which are not usable if the display is too small and need to switch to a different presentation and/or omit the elements.

Upvotes: 3

Views: 665

Answers (1)

aaaidan
aaaidan

Reputation: 7316

Short answer: No. There's (currently) no way to accurately design for the web using physical units.

Longer answer: you can only try to rely on the size of a "CSS Pixel" being roughly the same between devices, since device manufacturers have a vested interest in preserving the usability of sites when they have "high" pixel densities (~> 90 dpi).

A couple of notable exceptions:

  • the iPad mini is the same resolution as the original iPad, but (obviously) much smaller.
  • Opera on Android offers to pretend to be a desktop browser, including a fake device-width, etc...

Upvotes: 1

Related Questions