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 commentsNo, but it helps to enjoy and respect visual layout challenges. Without appreciation of design, particularly web UI, you won't have much to aim for except MVP.
With programming, you are not usually switching back and forth between code and some visual layout element. CSS on the other hand, is an endless game of tweak, refresh, repeat. It's not for everyone.
BTW, Flexbox is now widely supported, and is much nicer to work with than trying to float DIVs, which nobody ever liked or found easy. Flexbox provides a nice way to center your elements horizontally and/or vertically, not to mention very nice control of spacing and item-level responsive sizing with flex-shrink.
This is not to say CSS doesn't deserve any blame--it's a bad layout description language, as evidenced in part by the fact that the recent grid+flexbox additions are much better (where supported) than old-school CSS.
The suggestion of building a page from scratch is good and helpful And the next time a CSS friend wants to learn JavaScript I will suggest they start by learning i386 assembly language :-)
It often seems like it would be easier to make 3 WYSIWYG designs for small, medium, and large screens. The device and/or server would pick the best fit of the 3. In other words, WYSIWYG x 3 < autoflow design time.
Reinventing 3 wheels is easier than reinventing one rocket.
Footnote 1: Often people fudge them to work most of the time, but glitches often show up over time as new browser or OS brands/versions come out and expose one's accidental fudging-based version lockin.
All comments shown.
Couldn't load more comments. Check your connection and try again.