|
|
|
|
|
by hombre_fatal
1156 days ago
|
|
You can always zoom the website using built-in OS zooming. However, browser zooming incurs layout logic. It's no different that resizing the browser viewport. Code is run on the site (whether CSS or JS) to determine how the site should render at that size. CSS/JS is run even when loading the site in the first place. There is nothing special about zooming, so it's like asking why layout code has to be run when you visit a site. Well, you can turn off JS and CSS styling, but that's too hamfisted for most people. Here's how a site can load different stylesheets depending on viewport width: <link rel="stylesheet" media="screen and (min-width: 601px)" href="desktop.css" />
<link rel="stylesheet" media="screen and (max-width: 600px)" href="mobile.css" />
It's unclear to me what you think should happen on first website load vs. zooming. |
|