Toolpuffin

    Loading...

    Up and down to choose, Enter to open, Esc to close.

    A small course in 9 short lessons on the two layout tools of CSS. You start with Flexbox: place boxes in a row or a column, add a gap, spread them with justify-content, centre them with align-items, let them wrap and let one box fill the rest. Then you move on to Grid: columns with repeat and fr, an item that spans two columns and a grid that adapts to the screen with auto-fit and minmax. Every lesson has a live preview next to the editor, a hint and a model answer. The course checks your CSS with simple rules, so a different correct way of writing it can sometimes be marked as not yet right: open the hint to see the expected form. Your code stays in your browser and your progress is remembered there.

    Features

    • 9 short lessons on Flexbox and Grid
    • Live preview next to the editor
    • Check my answer, a hint and the model answer for every lesson
    • Your progress is remembered in this browser

    How to use Learn CSS Flexbox and Grid

    1. Read the lesson and the task.
    2. Change the CSS in the editor and watch the preview.
    3. Press Check my answer. Use the hint or the answer if you are stuck.
    4. Go to the next lesson.

    Frequently asked questions

    When should I use Flexbox and when Grid?

    Flexbox places items in one direction, a row or a column, and is handy for menus, toolbars and a row of cards. Grid places items in rows and columns at the same time, which suits a page layout or a gallery. You can use both on the same page.

    Do I need to know HTML and CSS first?

    A little helps. If you have never written a tag or a CSS rule, start with the course Learn HTML and CSS on this site, then come back here.

    Why is my correct answer marked as not yet right?

    The course checks your CSS with simple rules, for example that .row has display: flex. A different but correct way of writing the same layout can be missed. Open the hint to see the form the lesson expects.

    Is my code saved?

    Only which lessons you finished is saved, in this browser. The code you type is not stored or sent anywhere.

    Guides

    Related tools