Hacker News new | ask | show | jobs
by vinceguidry 4588 days ago
I'm talking about a simple container div. Works everywhere.
1 comments

Yes, I understood you.

I thought it was bizarre that you thought having every author of a webpage put some noise in their code was the right place to fix your technology stack.

It's not noise, it's presentation markup. That's what HTML/CSS is for. To manage the presentation of information. It's not that hard. Learn a little responsive CSS and have the div go away if the browser's width drops below, say, 600px.

Visual presentation is a hard problem, has been ever since the tele-type days. You're always going to need some "noise". I'm not saying you have to go full-hog with design bling, but you should at least learn enough about responsive CSS so that your site is usable across the three main types of screen it will be displayed on.

You don't need responsive CSS, all you need is max-width.

The (technically) ideal place to solve this is in your browser's user stylesheets (then you can have the page look however you like!), but that's a bad solution right now for obvious reasons (how many people even know that they exist?).

User stylesheets will always suck, because the pages you're depending on for your stylesheets to work is a concretion, not an abstraction. You're just going to have constant problems with the user CSS conflicting with the creator's styling.

The right way to do this would involve an evolution in the community where you could easily get the content you need in JSON format or similar. Then you can create your own presentation, or, more likely, subscribe to a site/service that collects user-created presenters.

> easily get the content you need in JSON format or similar

When user stylesheets were conceived this is what HTML was.

JSON is a data format. HTML is a markup language. You don't store data as HTML, because it's not intended to store data, only presentational markup.
I would still argue that making the browser aware of the screen it is using (or perhaps, aware of the screen real estate it currently occupies and the text size preference of the user) is a better solution than adding a div to every serious web page.

Also, I'm pretty sure that (at least for simple pages) styling the body element will work just as well.

Why would that be any better? The only thing the page displaying in any browser needs to be aware of is how big the viewing window is, and the DPI. With those two pieces of information, you can have anything that runs in a browser present a useful interface.

That way content can handle all the edge cases that different screens can throw at them. And different browsers can handle things like text sizes the way they want to.

You don't want to have to make individual websites cater to individual screens or browsers. There's just too many of both. The interface between them needs to be a loose coupling.

A better way to say what I was getting at is that a web browser that finds itself with a silly window size might better serve the user by only using a portion of it for the viewport.

This way a page with no extra width styling still gets presented to the user in a sensible fashion. It's probably a looser coupling than insisting that every page anticipate and handle the screens it might be viewed on.

The browser shouldn't be dictating how the web works. It's the creator's job to manage the complexity of presentation, you can't just push that responsibility onto your tech stack. The domain and expected use cases for web apps is just too broad for any browser to be making decisions like this.