Hacker News new | ask | show | jobs
by BinaryIdiot 3734 days ago
> totally creeps me out. I do it because other people refuse to use preprocessors and think that altering the HTML to include presentational details is fine (see Bootstrap.) But it still feels gross to me.

To be fair HTML is the presentation. I can understand not wanting to mix business logic from JavaScript into a page but CSS is just the other half of HTML.

If it makes it nicer you could use more generic class terms (such as page information or HTML structure location, etc).

1 comments

HTML is not the presentation.

HTML is the content and description of content. You put a <strong> tag around text to make it strong emphasis.

CSS is the presentation. Your browser sees the <strong> tag and applies its default style of making it bold.

They're both the presentation. Showing emphasis and structuring content is as much part of the presentation as CSS, maybe even more so if you care about backwards compatibility and graceful degradation.

This is just incredibly pedantic. For all practical purposes HTML + CSS is the presentation. Toss JavaScript into that if you want. Front-end work is the presentation.

It's not pedantic. It's the way it was designed. Just because people use tables for layout doesn't mean they were intended for that.

As far as graceful degradation, If I open a properly built page in a text-only browser, there are no styles. There's no real emphasis or bolding. There's just text. Because CSS didn't exist.

Now, if you want to live in the early part of the decade when it was OK to put inline styles and background colors in your HTML, that's fine. But the world evolved beyond that. HTML with <body bgcolor" is deprecated.

Because HTML is the content. CSS is how it looks. And JS is how it works.