Ask HN: Is it just me, or is CSS too damn hard?
499 pointsI'm a seasoned backend developer and systems administrator, with over 10 years of full-time programming experience. I've worked with anything from Assembly, C, Rust all the way to Python, Erlang, Elixir, PHP, Haskell, Lisp, Clojure.
When it comes to frontend, I have used React, Vue.js, ReasonML, Clojurescript and Elm extensively, and I know my way around web technologies in general. However, ever since I first started programming, I was NEVER able to get the gist behind CSS. I can't center my divs properly. I can't say "hey, CSS, this is the parent div, and all child divs must obey its size". I can't do anything basic on CSS without turning for help.
Incidentally, but very likely related, I always failed to have any glimpse into how design works. I have no idea which colors "go" with which ones, and pretty much all fonts look like the same for me.
I'd like to know the experience from fellow programmers. Is CSS an "art" thing? Is it common for other developers to have issues with it, or is it just me? Is there any material out there that made CSS "click" for you?
Comments (340) 150 threads
Earlier commentsmany solutions seem to be born out of the fashion of that time. an animated dropshadow is easy, styling a checkbox, it's label and making it work for rich devices is damn hard.
(for the latter you need to figure out the way to associate a label with a checkbox, hide the default checkbox, draw your own to style that, somehow get the state from the hidden original checkbox and than build a very weird wrapper, that invisibly enlarges the clickable/touchable area without bursting your layout or covering another touch zone)
I think medium did a whole blog post on how to get aesthetical authority over a text undergone.
To keep my sanity, I try to avoid touching it as much as I can (I use Semantic-UI which gets me most elements with little effort), and when I have to, I try to stick to the more recent, reasonable parts. Flexbox for example is understandable and predictable.
It makes writing CSS enjoyable and fun
https://www.youtube.com/watch?v=wesUO81YX0U
It may be a good substitute for a first draft, but your website will be much leaner and cleaner without it.
Also, I can never get over the fact, that the bootstrap devs seem incapable of delivering UI elements like dropdowns without additional javascript or can't even include a no-js fallback. That doesn't really create confidence in their abilities as web developers.
All comments shown.
Couldn't load more comments. Check your connection and try again.