cellio: (Default)
[personal profile] cellio

I don't know a lot about the nuts and bolts of responsive design (the "how", I mean), but Stack Exchange is moving toward it so I'm starting to pay attention.

Meanwhile, my ancient tablet seems to be in its death throes, so I've started to look around at what's out there these days, and I realized something. I'm looking at some 10" tablets with resolutions like 2048x1536. My 30-inch monitor at work is something like 2500px wide. These are, of course, not even remotely the same size pixels. Pixels have always varied with the size of the monitor, of course, but a ~10" tablet used to be in the range of 1024 or 1280 wide (landscape), not twice that.

I've seen discussions of SE's upcoming responsive design that say things like "and at widths under 900px it does this" and "the max width for the content area is (some number of pixels)".

How does this work? How can I see reasonable "real-world" sizing of things on both my big monitor and my tablet when designers are measuring things in pixels and tablets are doing crazy-dense things with pixels these days? I guess the same can be said of 4k displays (which I don't have). Do these ultra-dense devices somehow tell the browser "no, really, treat me as half that for layout purposes"? On a tablet will I need to have tons of zoom -- but still struggle to see the actual application's controls, because those don't zoom when you make content bigger?

I must be missing something obvious. Anybody want to enlighten me?

(no subject)

Date: 2018-06-11 09:03 am (UTC)
durham_rambler: (Default)
From: [personal profile] durham_rambler
[personal profile] shewhomust has drawn your post to my attention. Let's get techy...
There is a meta tag, viewport, which controls how things are displayed. On this Dreamwidth page it is
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
The width=device-width tells the browser to use the actual width of the screen to render the web page. Without this, a mobile device would probably render the page on a width of around 980px then compress it to fit the screen, combining several pixels together.
The other parameter, initial-scale=1.0, tells the browser to render the page so that one pixel on the page equals one pixel on the screen.
If you search on meta viewport there's a lot more information out there. This page on the Google site has an example of a web page with and without a viewport tag.

But this relates essentially to displays on smartphones. These very wide devices must be doing something under the covers to scale the pixels with a default initial-scale of less than 1. The benefit of a wide screen must be smoother pictures and text.

Style sheets can contain media queries to render differently on screens of different sizes. You can use this so that the “hamburger” symbol ☰ displays on smaller screens: on larger screens that part of the page has a style of display:hidden

I hope that helps…
Edited Date: 2018-06-11 09:08 am (UTC)

(no subject)

Date: 2018-06-11 01:18 pm (UTC)
dsrtao: dsr as a LEGO minifig (Default)
From: [personal profile] dsrtao
https://webplatform.github.io/docs/tutorials/understanding-css-units/

TL;DR: The CSS "pixel" is an abstract unit used to draw on a web page. No matter what the device resolution is, CSS asks it to map 96 pixels to one inch of real world. The system may decide to present it a little differently.

Similar things happen in most GUIs.

(no subject)

Date: 2018-06-11 11:04 pm (UTC)
mdlbear: blue fractal bear with text "since 2002" (Default)
From: [personal profile] mdlbear
Yeah; this is the key piece of information: CSS pixels aren't real pixels; it's up to the device to figure out what they translate to. Printers do something similar: postsript and PDF measurements are all in "points", defined as 1/72 of an inch.

Expand Cut Tags

No cut tags