Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Lära Justifying Content Horizontally | Flexbox
CSS Fundamentals
course content

Kursinnehåll

CSS Fundamentals

CSS Fundamentals

1. Introduction to CSS
2. Text Styles
3. Box Model and Element Spacing
4. Flexbox
5. Decorative Effects

book
Justifying Content Horizontally

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

css

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.

html

index.html

css

index.css

copy

flex-end

All items are at the axis end.

html

index.html

css

index.css

copy

center

All items are in the center.

html

index.html

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.

html

index.html

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.

html

index.html

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

Var allt tydligt?

Hur kan vi förbättra det?

Tack för dina kommentarer!

Avsnitt 4. Kapitel 3

Fråga AI

expand
ChatGPT

Fråga vad du vill eller prova någon av de föreslagna frågorna för att starta vårt samtal

course content

Kursinnehåll

CSS Fundamentals

CSS Fundamentals

1. Introduction to CSS
2. Text Styles
3. Box Model and Element Spacing
4. Flexbox
5. Decorative Effects

book
Justifying Content Horizontally

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

css

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.

html

index.html

css

index.css

copy

flex-end

All items are at the axis end.

html

index.html

css

index.css

copy

center

All items are in the center.

html

index.html

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.

html

index.html

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.

html

index.html

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

Var allt tydligt?

Hur kan vi förbättra det?

Tack för dina kommentarer!

Avsnitt 4. Kapitel 3
Vi beklagar att något gick fel. Vad hände?
some-alt