Flexbox

flexbox
<div class="d-flex align-items-start">...</div>
<div class="d-flex align-items-end">...</div>
<div class="d-flex align-items-center">...</div>
<div class="d-flex align-items-baseline">...</div>
<div class="d-flex align-items-stretch">...</div>
flexbox
Display: flex
Flex-direction: row | row-reverse | column | column-reverse
align-self: flex-start | flex-end | center | baseline | stretch
justify-content: start | center | space-between | space-around | space-evenly
Source:nethub.af
flex box in css
<!--basic--flex--layout-->
<html>
<head>
<style>
.parent{
display: flex or inline-flex;
flex-direction: row or column;
flex-wrap: wrap or wrap-reverse;
}
</style>
</head>
<body>
<div class="parent">
<div class="child-1"></div>
.
.
.
</div>
</body>
</html>
css flexbox
<style>
.container {
display: flex;
flex-direction: row;
column-gap: 2rem;
}

.box {
background: yellow;
width: 6rem;
height: 6rem;
}
</style>

<div class="container">
<div class="box">1</div>
<div class="box">2</div>
<div class="box">3</div>
<div class="box">4</div>
</div>
flexbox css properties
Display: flex
Flex-direction: row | row-reverse | column | column-reverse
align-self: flex-start | flex-end | center | baseline | stretch
justify-content: start | center | space-between | space-around | space-evenly
flex-box by order
.item {
order: 5; /* default is 0 */
}
flexbox
<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;}
Source: medium.com

Leave a Comment