Lurker News
Hey HN,

I'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 comments
dakom#
Yes CSS is too damn hard.

Too hard to learn? No. Too hard to use? No. Too hard to do elegantly? No.
It's too hard because it doesn't need to be nearly as hard as it is. Advanced layout can be done using techniques like pivot, relative anchoring and alignment, and lots of other approaches that CSS lacks.
It's too hard because what is there is broken. Even the new stuff (try to select a row in an auto-adjusting grid. You can't yet, and the powers that be will eventually fix that... which is ridiculous for a modern release)
It's too hard because it's neither how designers think, nor how programmers think, nor how users think. So you need to write it in some weird hodgepodge that accounts for none of those and all of those.
It's also too hard because due to the difficulty it takes a lot of time to get good at, and so we as non-CSS gurus don't invest the time we need to digest it... because why would we when it shouldn't require that sort of investment?
At the end of the day it's almost like going to your neighbor's house but some committee forces you to walk in zigzags and on your hands. It'll get you there, and you will become so good in the process you could work in a circus, but it's an unnecessary pain when you just want to drop off a cup of milk.

olingern1 reply#
I was like this 5 years ago. It's trite and no one wants to hear it, but the basics go a long, long way.

All of that stuff you hear about in front-end interviews ( like the box-model and relative vs absolute positioning ) comes in handy.
I do admit that pre-flexbox CSS did require some wizardry and hacks here and there. I think "modern CSS" is quite enjoyable and we're able to enjoy a time where we no longer need CSS frameworks to do all the "hard work"

vittore1 reply#
I remember times of supporting x-platform css for IE5/5.5/6 and FF1. IMO everything that people complaining right now is nothing with the Wild West that was back then.
olingern#
Indeed, I think times and CSS has gotten much better. MDN's documentation is great, and browsers are finally starting to standardize.
sgc#
People have mentioned flex and grid a few times. I would add using box-sizing: border-box; solves a lot of problems stemming css' default of measuring from the inside of elements that need to fit together from their outsides. See https://css-tricks.com/almanac/properties/b/box-sizing/

Load more comments