/* Display: It enables a flex container; inline or block */
display: flex;
/* Flex-direction: Determines the direction of the items. */
flex-direction: row
/* Flex-wrap: Determines whether the flex items should wrap or not. */
flex-wrap: wrap;
/* Justify-content: This property is used to align the flex items. flex-wrap: nowrap; */
justify-content: flex-start;
/* Align-items: Determines the behavior for how flex items are laid out along the cross-axis on the current line. */
align-items: flex-start;
/* Align-content: specifies the distribution of space between and around content items along a flexbox's cross-axis */
align-content: flex-start;
/* Order: It is used to control the order in which flex items appear in the flex container. */
order: 1;
/* Flex-grow: It allows representing the ability of a flex item to grow by your choice. */
flex-grow: 1;
/* Flex-basis: This defines the default size of an element before the remaining space is distributed */
flex-basis: 50%;
/* Flex-shrink: Defines the ability for a flex item to shrink. */
flex-shrink: 3;
/* Align-self: Sets the alignment for individual items. */
align-self: flex-start;
/*
Most Common Flexbox properties:
display: flex;
flex-direction: row / column; --> used to justify the direction of content
flex-wrap: wrap; --> holds the content inside flexbox container
These Properties are also part of flexbox and only apply on a container which contain flexbox property
Justify content:
center
start
end
baseline
space-around -->commonly used
Align items:
center
baseline
fr = fill up any available space
*/
.flexbox {
display: flex;
flex-direction: row;
flex-wrap: wrap;
justify-content: space-around;
/* column-count: 2;
columns: 2; */
}
.flex-container {
display: flex;
background-color: DodgerBlue;
}
.flex-container > div {
background-color: #f1f1f1;
margin: 10px;
padding: 20px;
font-size: 30px;
}
/* A Flexible Layout must have a parent element with the
display property set to flex. Direct child elements(s) of
the flexible container automatically becomes flexible items. */
<div class="my-container"> <img src="my-picture.jpg" alt="scenic view" /> <p>Lorem, ipsum dolor sit amet consectetur adipisicing elit. Esse facilis provident culpa eos sed sunt voluptates.</p></div>.my-container { display: flex; flex-direction: row;}
/*This defines a flex container; inline or block depending on the
given value. It enables a flex context for all its direct children.*/
.container {
display: flex; /* or inline-flex */
}
/*Note that CSS columns have no effect on flex container*/