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 37 of 150

WestCoastJustin2 replies#
It's not just you. I'd recommend using a CSS framework. Have you checked out Bootstrap [0]? I was very much the same way (focused on backend). CSS is just a means to an end for me, in that I just wanted something that doesn't look like total garbage, so I used Bootstrap for the frontend bits. Allows you to quickly get up and running using the examples without learning too much CSS [1]. Just find something that looks like what you want and then copy/paste. Much much easier.

They have a pretty nice grid system that allows you all types of formatting options (desktop/mobile). All types of text formatting options too. Honestly, I think you're way better off learning something like Bootstrap unless you want to do this professionally.
[0] https://getbootstrap.com/
[1] https://getbootstrap.com/docs/4.2/examples/
EDIT: downvotes? Why not mention why you don't like bootstrap and share with the larger thread? At least, then it is useful to everyone else.

odilontalk1 reply#
There are some use cases for Bootstrap for sure, but I feel you need grasp the basics of CSS first. It is like using jQuery for everything instead learn proper Javascript.
WestCoastJustin#
Until you get to the point where you are reinventing jQuery vs just using it. The same thing can happen with CSS, you are formatting all this stuff, getting a layout, spending tons of time fixing layout issues in CSS, etc. Where your time might be better spent just using Bootstrap and working on your app vs CSS.
aphextron1 reply#
Don't use bootstrap for anything beyond personal project prototypes. It ends up being a complete nightmare for maintenance. Coupling of DOM with presentation and state is the number one thing we should be avoiding in modern JS apps.
WestCoastJustin1 reply#
Interesting, I'll have to read about that. This has totally not been my experience.
aphextron1 reply#
It works great... for a while. Then you end up wanting to tweak something here and there, start adding classes to things, and you realize you want to do something that requires changes to the DOM within a component and you're screwed. Or you ignore the fact that the right way would be modifying the DOM, use some hacky CSS to kludge it, and you start getting browser inconsistencies. Either way you end up stuck with 100k of dependencies to style a popover and a dropdown that could have just been defined in a design system from the get-go and done with minimal CSS in a React/Vue type architecture scoped to the individual component.

Continue this thread — 1 reply