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
mxuribe#
You are not alone! Beyond the bugs and inconsistency that web browsers implemented, I've always felt that css was unnecessarily over-complicated. During development on projects, it seems to be the thing that used to create the most hair-pulling frustration. But nowadays, i have learned to let go of some things, including any OCD feelings about css. Either i construct the most basic views, and hand it over to someone else who is willing to put up with css (and who is better at picking colors)...or simply construct the basic views - and stick to the bare/default view without any colors or complex css applied at all.
azangru#
As anything, CSS requires practice. Imagine writing Haskell after having experience only with Python or C — you will probably expect it to be different — and difficult. You will probably want to read a book or two about Haskell, going from the first principles to real-world programs. Starting directly with real-world problems in Haskell will probably leave you frustrated and confused.

Perhaps you were never interested in CSS, and never gave it much thought; but it too has its own basic principles, after learning which it will be easy to say, like you want: "hey, CSS, this is the parent div, and all child divs must obey its size".

LarryMade2#
CSS is pretty simple and like a programming language you can overwork it to high complexity. And most people who aren't used to how to optimize it, just make a usable kludge of CSS.

When I first was going through CSS to learn it I thought it was the worst thing in the world - manly because many people had copied CSS without knowing what how to really achieve - or inheriting disparate css blocks which add to the confusion.
Once understood and starting from scratch, you can make it a lot more logical and flexible without much of a mess. My big tip - learn to break down style parts into separate classes and then combine the classes as needed!

simonhamp1 reply#
First of all, CSS is t like any programming language. It’s a cascade of properties that is tightly coupled to the tree-like nature of HTML. You don’t ‘understand’ CSS on it’s own; it must be in tandem with suitable HTML.

Secondly, the visual aspects of design (colours, fonts, layout) have got nothing to do with your grasp of CSS. I am not a designer and really struggle to make pages look good without a professional’s help. But give me a beautiful design and I’ll code it up in lovely CSS for you no problem.
P.S. check out Tailwind CSS https://tailwindcss.com/

nepeckman#
Seconding the recommendation for Tailwind. I know functional css is controversial, but Tailwind isn't dogmatic about it. Sensible defaults for colors, fonts, padding, etc. And unlike Bootstrap, when you use Tailwind, you're actually learning css instead of a framework. I feel like my css is a little better since I started using Tailwind.

Load more comments