Consider two screens:
- same resolution
- same orientation
- but different physical sizes
Exempla gratia:
How can i target different screen sizes with CSS media queries?
Because, for example:
- for the one 1920px wide display, it is uncomfortable to read the long lines of text that stretch edge-to-edge, and you'd want some padding, margin, or other spacing to narrow the text
- but for the other 1920px wide display, you want text to go edge-to-edge
Bonus Chatter
And you can't try to invoke User-Agent
strings:
- i'm asking about CSS media queries, not User-Agent strings
- the 4" screen could be connected to a PC
- the 18" screen could be connected to a phone.
And you can't try to weasel out of the question by talking about orientation, or by musing if the screen supports touch or not, nor can you use the handheld
attribute
I'm asking about using CSS to style a page based on the (physical) size of the screen.
Bonus Reading
- Detect if a browser in a mobile device (iOS/Android phone/tablet) is used (tries to rely on resolution)
- Media Queries: How to target desktop, tablet, and mobile? (tries to rely on resolution)
- How To Build A Mobile Website
- How To Use CSS3 Media Queries To Create a Mobile Version of Your Website
- Using Media Queries For Responsive Design In 2018
- What media query breakpoints should I use? (tries to rely on resolution) ("breakpoints" is another word for "pixels")
- Media Query for Large Desktop
- CSS media queries for handheld and not small browser screens
- Media query about screen size instead of resolution