My First CSS
CSS can be hard to grasp when you're starting out. It can seem like magic wizardry and you can very easily find yourself playing whack-a-mole adjusting one property only to have something else break. It is frustrating, and that was my experience for quite a long time before things suddenly seemed to "click".
Reflecting back on this time, I think there are a few key concepts that were vital to things finally all making sense and fitting together. These were:
- The Box Model (e.g.
box-sizing
,height
,width
,margin
,padding
)- Layout (e.g.
display
)- Document Flow and Positioning (e.g.
position
,top
,left
, etc.)There are also some useful concepts to keep in mind when building reusable and composable components.
Source: My First CSS, an article by Nathan Hardy.