CSS describes how a page looks. Choose a selector, adjust the space around an element, and arrange a few pieces into a layout that can flex.
Three lessons · about 20 minutes0 of 3 complete
LESSON 1 · SELECTORS & RULES
Choose what to style.
A CSS rule has a selector and a set of declarations. The selector chooses an element. Each declaration pairs a property with a value. A class selector starts with a dot and can be reused on several elements.
Read it out loud: “For every element with class card, use dark green text, a soft green background, and rounded corners.”
Quick check: what character starts a class selector?
A small step counts.
LESSON 2 · SPACE & THE BOX MODEL
Give each element room.
The browser lays every element out as a box. The content sits inside, padding adds space around the content, border wraps the padding, and margin creates space outside the border.