0

What would cause a 2560px wide device to claim to be 1138 pixels wide? It it because it's Android? I'm getting very different font size compared to dev tools on a desktop and a div sized to 2560px wide is 2.5X the width of my page on the tablet. I'm super confused. Tried every meta tag and forcing it to be 0.45 device with seems very wrong and hacky.

document.body.clientWidth

My iPhone 6 says 667px which is correct. Desktop browsers return correct width too. It's just this Samsung s4 tab that seems to return ting dimensions and create gargantuan text sizes.

Eric_B
  • 149
  • 10
  • If you're asking about html, you need to specify the browser. Chrome? Firefox? WebView? Some weird off brand that Samsung bought (many of their early devices did this). Other? ANdroid isn't iOS, there isn't one browser across all devices. – Gabe Sechan Oct 04 '18 at 17:43
  • Chrome on a Samsung. I've assumed that was the default, I don't use Android so it's all new to me. The browser called "internet" does the same. – Eric_B Oct 04 '18 at 17:45
  • The line of code you have posted is assigning the value `1138` to `document.body.clientWidth`. – hcs Oct 04 '18 at 17:45
  • alert(document.body.clientWidth) -- sorry that wasn't suppose to be literal (fixed code example) – Eric_B Oct 04 '18 at 17:47
  • So on Android I should not expect it to find accurate pixel dimensions? – Eric_B Oct 04 '18 at 18:16
  • 1
    Sounds like it's reporting "density-independent pixels" instead of actual physical pixels. https://stackoverflow.com/a/2025541/8298909 for more info. – Ben P. Oct 04 '18 at 19:13

0 Answers0