News for hackers. Stuff that matters.
Re:My Current HTML Boilerplate by lrem on Tuesday April 27, 2021 @03:12AM (#26952986)
<meta name=viewport content="width=device-width,initial-scale=1">

Excuse my ignorance: what the heck does this achieve?!

Re:My Current HTML Boilerplate by ohazi on Tuesday April 27, 2021 @03:19AM (#26953034)
It's an incantation to make the page look slightly less stupid on a phone.

https://www.w3schools.com/css/css_rwd_viewport.asp for an example image

https://developer.mozilla.org/en-US/docs/Web/HTML/Viewport_m... for more detailed info

Re:My Current HTML Boilerplate by hawski on Tuesday April 27, 2021 @03:21AM (#26953046)
So the html looks as god intended on mobile devices. It became necessary, because web pages squeezed to mobile sizes were looking terrible with all those sidebars bent and excessive padding and margins. So Apple (I believe it was them) made this workaround, by default your phone renders pages scaled, like it's a window to your desktop computer's maximized browser. Then it looked good. But what about pages that are responsive or just look good no matter the window size? That's the line that needs to be there.
Re:My Current HTML Boilerplate by enriquto on Tuesday April 27, 2021 @03:45AM (#26953172)
if you remove all css it looks good again on mobile devices
Re:My Current HTML Boilerplate by hawski on Tuesday April 27, 2021 @03:52AM (#26953217)
Thanks! I didn't know about this, but it does make sense. Is there a way to limit the max-width of text without CSS?
Re:My Current HTML Boilerplate by SahAssar on Tuesday April 27, 2021 @03:20AM (#26953040)
It sets mobile browsers use actual widths and not emulate desktop width.
Re:My Current HTML Boilerplate by la_fayette on Tuesday April 27, 2021 @07:25AM (#26954493)
it is not exactly the actual width of the device, but the default viewport width, given in CSS pixels. E.g. for the iphone 6 it is 375 pixel, although the physical width is 750 pixel...
Re:My Current HTML Boilerplate by SahAssar on Tuesday April 27, 2021 @10:46AM (#26956614)
Yeah, but the same is true for desktops/laptops that use scaling. I think that people are used to the fact that 1 render pixel does not always equal 1 physical pixel.