There’s a lot of CSS love & hate that flows around online, and one of the key reasons it is so polarizing is that it takes a different mental model than most other programming.
Author Max Böck has put together a list of some of the items that go into that mental model:
For most people who write CSS professionally, the mindset just comes naturally after a while. Many developers have that “aha!” moment when things finally start to click. It’s not just about knowing all the technical details, it’s more about a general sense of the ideas behind the language. I tried to list some of these here.