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

Show all comments

Showing thread 59 of 150

roryokane#
When I was struggling with CSS at my first job (2011), the thing that made it click for me was learning the significance of the `display` property and its possible values. After I learned that each `display` value causes the element to be rendered in a certain way, and that some CSS properties were only useful for certain `display` values, it became much easier to predict how the layout would look and to organize the CSS properties in my head.

For example, it cleared up a lot of questions when I learned that `display: block` elements naturally expand to the greatest width they can while matching the height of their contents.
Also, the Mac app CSSEdit (now folded into Espresso; https://espressoapp.com/) helped me learn the various CSS properties thanks to its GUI interface that listed properties by category, such as Text, Decoration, and Layout. It had icons for each possible value of each property that made it easy to remember what values each property supported. A useful feature of the app was letting me load an arbitrary web page and edit its styles with its GUI editor – I could see which properties were more often useful and how switching the between the possible values would change the look.