Note that there are some explanatory texts on larger screens.

plurals
  1. POActual Mobile Resolution
    primarykey
    data
    text
    <p>I'm new to HTML5 &amp; CSS3 so I'm working on a simple project to learn it better. I recently discovered responsive design so I am creating a page that scales to my phone. I using media queries, I created two states, one for screens 640px (mobile) and smaller and one for screen 641px and bigger (desktop). The site works fine, showing the correct styles on my desktop when I scale the window and showing the correct style when I view it on my phone.</p> <p>However, after running the site, I decided to check the resolution of my HTC One - it's 1080p. My phone displays the 640px site regardless of orientation. I'm wondering why this happens; the phone's higher resolution shouldn't trigger the mobile state, but it does. I'm thinking I might be confused on how resolutions actually work. </p> <p>So, how do I determine the true resolution of phones (and tablets) so that I can create appropriately scaled sites for them? </p> <pre><code>//Mobile @media screen and (max-width: 640px) { ... } //Desktop @media screen and (min-width: 641px) { ... } </code></pre> <p><strong>Edit</strong> Thanks to JoshCs comment below, I realized that I had the viewport meta tag in use from a tutorial. I'd like to revise my question to ask: how does the viewport tag determine what resolution to display for any given device (how do I determine the viewported resolution based on the dimensions of a device)?</p> <pre><code>&lt;meta name="viewport" content="width=device-width; initial-scale=1.0"&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload