CSS tutorial

Colors, spacing and layout. Make your HTML look the way you want.

Start lesson 1: What is CSS?

10 lessons

  1. What is CSS?(completed)

    CSS controls how HTML looks. Learn what a CSS rule is made of and where to put it.

    Practice: 3 exercises and 3-question quiz

  2. CSS selectors(completed)

    Target elements by name, by class or by id, and learn when to use each one.

    Practice: 3 exercises and 4-question quiz

  3. The box model(completed)

    Every element is a box. Understand content, padding, border and margin, and how they add up.

    Practice: 3 exercises and 3-question quiz

  4. Colors and backgrounds(completed)

    Set text and background colors with names, hex codes and rgb(), and add gradients.

    Practice: 3 exercises and 3-question quiz

  5. Text and fonts(completed)

    Control font family, size, weight, line spacing and alignment.

    Practice: 3 exercises and 3-question quiz

  6. The display property(completed)

    Switch elements between block, inline, inline-block and none.

    Practice: 2 exercises and 3-question quiz

  7. Flexbox(completed)

    Line items up in a row or column and share out the space between them.

    Practice: 3 exercises and 3-question quiz

  8. CSS grid(completed)

    Build layouts with rows and columns at the same time.

    Practice: 3 exercises and 3-question quiz

  9. Positioning(completed)

    Move elements out of the normal flow with relative, absolute, fixed and sticky positioning.

    Practice: 3 exercises and 3-question quiz

  10. Responsive design(completed)

    Make one page work well on phones, tablets and desktops with flexible sizes and media queries.

    Practice: 2 exercises and 3-question quiz