Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

The thing is HTML is not layout free if you use it as intended.

For instance different layouts are defined for table, span or div tags. The same goes for presentation, where h1/h2/h3, input or select tags have a default presentation. You can override most of these defaults (some are still pretty hard to override), but it's still baked in; would your CSS be ignored or not loaded for any reason and you're back on the defaults.

Cleanly separating data and presentation into HTML and CSS only works if you ignore all the semantic tags and use div everywhere. I personally gave up a long time ago on semantic html, that's not the opinion I hear the most.

Either way, I think most people see HTML as base layer with data, presentation and baked in behaviors, and CSS and JS as a enhanced layer on top of that.



Presentation and semantics are not the same thing. All the default presentation is easy to override if you know what you're doing. CSS is pretty damn simple. You should learn the basics. Namely: cascading, specificity, nesting, inheritance, the _BOX_ model. If you think presentation and semantics are mutually exclusive then you're doing it wrong. Very wrong! The example you give about the default layout of elements can easily be changed using the display property: https://developer.mozilla.org/en-US/docs/Web/CSS/display


On a theorical point of view I agree with you. In practice there's a world of difference in presentation if you use the semantics for a select box or roll your own solution.

In a way I am very intersted in what Google is doing with the material UI. They seem to be ditching native components to reimplement everything.

Basic css is simple and fun. It gets hairy when you try anything mildly complex, and you start to learn magic spells when playing the "I made this screen in Photoshop, make it pixel with pixel perfect fidelity in HTML" game.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: