Skip to main content

Command Palette

Search for a command to run...

CSS: Flex-box property

Published
1 min readView as Markdown
CSS: Flex-box property
P

I am front-end developer.

What is flex-box?

=> It makes, easier to design a flexible responsive layout without using positioning and float property.

=> Flexbox is one dimensional method.

=> It has powerful alignment capabilities.

The basic concept of flexbox:

There are two types of axes of flexbox

  1. Main axis
  2. Cross axis

Flexbox: To start using the flexbox property, first you need to define a flex container.

flex-container { display: flex; }

E2zQtgjX0AY2AD1.png

The flex container properties are

  1. flex-direction
  2. flex-wrap
  3. flex-flow
  4. justify-content
  5. align-items
  6. align-content

Different flexbox properties

{

display: flex;
flex-direction: row;

}

E2zQtgjX0AY2AD1.png

{

display: flex;
flex-direction: column;

}

2.png

{

display: flex;
flex-direction: row-reverse;

}

3.png

{

display: flex;
flex-direction: column-reverse;

}

4.png

Justify-content property is used to align the flex items

{ display: flex; justify-content: center;

}

5.png

{ display: flex; justify-content: space-between;

}

6.png

{

display: flex; justify-content: space-evenly;

}

7.png

{

display: flex; justify-content: flex-start;

}

8.png

{ display: flex; justify-content: flex-end; }

9.png

I'll cover the rest of the properties in the next article.

24 views

More from this blog

Pritam Kumar

7 posts

I'm a front-end developer.