Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to target Galaxy Nexus and Nexus 7 with media queries?
    primarykey
    data
    text
    <p>I have two devices that I'm testing site design with. Samsung Galaxy Nexus and Asus Nexus 7 tablet. I'm having a really hard time figuring out how to target these individual devices with media queries. I'm not sure about what values to use for <code>max-width</code> or to use <code>max-device-width</code>. Also I can't figure out what order to put the media queries in...</p> <p>According to: <a href="http://responsejs.com/labs/dimensions/" rel="noreferrer">http://responsejs.com/labs/dimensions/</a></p> <ul> <li>Galaxy Nexus Portrait: <code>document.documentElement.clientWidth = 360</code></li> <li>Galaxy Nexus Landscape: <code>document.documentElement.clientWidth = 598</code></li> <li>Nexus 7 Portrait: <code>document.documentElement.clientWidth = 603</code></li> <li>Nexus 7 Landscape: <code>document.documentElement.clientWidth = 966</code></li> </ul> <p>I need to target the following:</p> <ul> <li>Galaxy Nexus Portrait and Tablet</li> <li>Galaxy Nexus Portrait</li> <li>Galaxy Nexus Tablet</li> <li>Nexus 7 Portrait and Tablet</li> <li>Nexus 7 Portrait</li> <li>Nexus 7 Tablet</li> </ul> <p>I tried the following for testing but didn't have good results... Not sure what I'm doing wrong. I was kinda just playing around with the numbers trying to figure out what worked and what didn't...</p> <pre><code>/* Galaxy Nexus (portrait and landscape) ----------- */ @media only screen and (min-device-width : 360px) and (max-device-width : 598px) { ul.top-menu { background: red; } } /* Galaxy Nexus (landscape) ----------- */ @media only screen and (min-width : 361px) and (orientation: landscape){ ul.top-menu { background: blue; } } /* Galaxy Nexus (portrait) ----------- */ @media only screen and (max-width : 360px) and (orientation: portrait) { ul.top-menu { background: purple; } } /* Nexus 7 (portrait and landscape) ----------- */ @media only screen and (min-device-width : 603px) and (max-device-width : 966px) { ul.top-menu { background: yellow; } } /* Nexus 7 (landscape) ----------- */ @media only screen and (min-width : 604px) and (orientation: landscape) { ul.top-menu { background: green; } } /* Nexus 7 (portrait) ----------- */ @media only screen and (max-width : 603px) and (orientation: portrait) { ul.top-menu { background: orange; } } </code></pre> <p>And FYI I know that you aren't really supposed to be so specific, targeting individual devices when doing Responsive Design, but I'm doing this mostly for as a test and need to do it in this case. Any help would be appreciated.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    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.
    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