BananaMaster

7 Flexbox and How display: flex, justify-content, align-items and flex-direction Work (HTML and CSS, Front End)

If you forgot something, click to go to the lesson

📘 Practical Tasks: Flexbox

For each task create separate classes in style.css and apply them to the correct tags.

📌 File structure: index.html + style.css

💡 Key rule: display: flex is always written on the parent, not on the child element.

✏️ Task 1 — flex-direction: row (default)

Three blocks stand in a row. Estimate the parent's size by eye:

✏️ Task 2

Three blocks stand in a column. Estimate the parent's size by eye:

✏️ Task 3

The block is aligned to the center horizontally. Estimate the sizes by eye:

✏️ Task 4

The block is aligned to the right edge. Estimate the sizes by eye:

✏️ Task 5

The block is aligned to the vertical center. Estimate the sizes by eye:

✏️ Task 6

The block is aligned to the bottom edge. Estimate the sizes by eye:

✏️ Task 7

The block is placed exactly in the center both horizontally and vertically. Estimate the sizes by eye:

✏️ Task 8

Three blocks — the outer ones are pressed to the edges, the middle one is in between. All are centered vertically. Estimate the sizes by eye:

✏️ Task 9

A column of two blocks is aligned to the bottom-right corner. Estimate the sizes by eye:

✏️ Task 10

Two flex containers are nested inside one. Estimate the sizes by eye:

📌 Important:
Each class is written separately in style.css.
Use HTML and CSS only.
Practice the properties: display: flex, flex-direction, justify-content, align-items.