I am trying to apply css based on the screen size of an Android device.
using media query:
@media all and (max-device-width: 480px) { //apply css style to devices of screens with width no larger than 480px }
and javascript:
window.innerWidth window.innerHeight screen.width screen.height
with or without metathete:
<meta name="viewport" content="width=device-width, target-densityDpi=device-dpi, initial-scale=1, user-scalable=no"/>
But no one works, I continue to receive invalid (or real, but not what I expect) values ββfor different Android devices ("screen.width" and "window.innerWidth" always show 320 pixels, even if I use devices with a size of 240X320 , 320X480 and 480X800).
How can I determine the actual physical size of Android devices?
thanks
source share