Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Impara Justifying Content Horizontally in Flexbox | Mastering Flexbox for Layouts
CSS Fundamentals

bookJustifying Content Horizontally in Flexbox

The justify-content property is instrumental in determining the position of flex items along the main axis. Its default value is flex-start.

justify-content: flex-start | flex-end | center | space-between | space-around;

Let's consider each case on practice. We will play with the list of cards.

flex-start

Default value, which makes all the items be at the start of the main axis.

index.html

index.html

index.css

index.css

copy

flex-end

All items are at the axis end.

index.html

index.html

index.css

index.css

copy

center

All items are in the center.

index.html

index.html

index.css

index.css

copy

space-around

It distributes all the items evenly along the main axis with a bit of space left at either end.

index.html

index.html

index.css

index.css

copy

space-between

It is very similar to space-around except that it doesn't leave any space at the axis on both ends.

index.html

index.html

index.css

index.css

copy
question mark

Which of the following values for the justify-content property will align flex items along the center of a flex container?

Select the correct answer

Tutto è chiaro?

Come possiamo migliorarlo?

Grazie per i tuoi commenti!

Sezione 4. Capitolo 3

Chieda ad AI

expand

Chieda ad AI

ChatGPT

Chieda pure quello che desidera o provi una delle domande suggerite per iniziare la nostra conversazione

Suggested prompts:

Mi faccia domande su questo argomento

Riassuma questo capitolo

Mostri esempi dal mondo reale

Awesome!

Completion rate improved to 2.5

bookJustifying Content Horizontally in Flexbox

Scorri per mostrare il menu

The justify-content property is instrumental in determining the position of flex items along the main axis. Its default value is flex-start.

justify-content: flex-start | flex-end | center | space-between | space-around;

Let's consider each case on practice. We will play with the list of cards.

flex-start

Default value, which makes all the items be at the start of the main axis.

index.html

index.html

index.css

index.css

copy

flex-end

All items are at the axis end.

index.html

index.html

index.css

index.css

copy

center

All items are in the center.

index.html

index.html

index.css

index.css

copy

space-around

It distributes all the items evenly along the main axis with a bit of space left at either end.

index.html

index.html

index.css

index.css

copy

space-between

It is very similar to space-around except that it doesn't leave any space at the axis on both ends.

index.html

index.html

index.css

index.css

copy
question mark

Which of the following values for the justify-content property will align flex items along the center of a flex container?

Select the correct answer

Tutto è chiaro?

Come possiamo migliorarlo?

Grazie per i tuoi commenti!

Sezione 4. Capitolo 3
some-alt