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
Show all comments
Showing thread 25 of 150
It uses two basic constructs: rule and its selector.
Selector is SQL's SELECT/WHERE statement essentially that says:
When the element conforms this condition it has these set of properties. Any element may have multiple rules applied with matching selectors in particular order (so called CSS specificity).
And there are 20-30 basic CSS properties defining different aspects of layout and rendering.
Yes, there are 200+ other properties (and counting) in the full set. But that's for Jedii and merely 10-20 of us who are in business of creating layout engines.
It used to be more of us but the ones from MS are lost for the Republic - all their events were bubbled up onto the Dark Side.