Setting the Flex Direction for Layouts
The flex-direction
property enables us to determine the direction in which flex items are arranged. By default, this property is set to row
, resulting in a left-to-right layout in browsers that use English as the default language. You can set it to:
flex-direction: row | column | row-reverse | column-reverse;
Let's consider the next website navigation as an example.
row
index.html
index.css
row-reverse
index.html
index.css
column
Pay attention to the width of the items; they cover the entire width of the parent.
index.html
index.css
column-reverse
index.html
index.css
Tak for dine kommentarer!
Spørg AI
Spørg AI
Spørg om hvad som helst eller prøv et af de foreslåede spørgsmål for at starte vores chat
Awesome!
Completion rate improved to 2.5
Setting the Flex Direction for Layouts
Stryg for at vise menuen
The flex-direction
property enables us to determine the direction in which flex items are arranged. By default, this property is set to row
, resulting in a left-to-right layout in browsers that use English as the default language. You can set it to:
flex-direction: row | column | row-reverse | column-reverse;
Let's consider the next website navigation as an example.
row
index.html
index.css
row-reverse
index.html
index.css
column
Pay attention to the width of the items; they cover the entire width of the parent.
index.html
index.css
column-reverse
index.html
index.css
Tak for dine kommentarer!