Table of contents
No headings in the article.
The flexbox in CSS is a one-dimensional model, it contains flexible and efficient layouts.It is a layout model which provide easy way to arrange items in a container.Flexbox is useful to create small scale layout and responsive layouts.
๐ ๐๐๐ญ๐ฎ๐ซ๐๐ฌ ๐จ๐ ๐ ๐ฅ๐๐ฑ ๐๐จ๐ฑ
Here are the features of flex Box.
Flexibility
Arrangement of items.
Order and sequencing of items.
Proper spacing
๐๐จ๐ฆ๐ฉ๐จ๐ง๐๐ง๐ญ๐ฌ ๐จ๐ ๐ ๐ฅ๐๐ฑ ๐๐จ๐ฑ
Majorly Here are two types of components in flexbox which are following.
๐. ๐ ๐ฅ๐๐ฑ ๐๐จ๐ง๐ญ๐๐ข๐ง๐๐ซ
Flex container is parent div which contains various divisions in itself.
๐. ๐ ๐ฅ๐๐ฑ ๐๐ญ๐๐ฆ๐ฌ
Flex items are the items which are inside of the container div.
Here is the example for creating flex Box.
<html>
<head>
<title>CSS Flex Box</title>
<style>
.container{
display : flex;
flex-direction: row;
background-color : #000;
}
.item{
background-color:#EB4D4B;
margin : 10px;
padding : 10px;
}
</style>
</head>
<body>
<h1>Hello CSS FlexBox</h1>
<div class="container">
<div class="item">Item1</div>
<div class="item">Item2</div>
<div class="item">Item3</div>
</div>
</body>
</html>
๐ ๐ฅ๐๐ฑ ๐๐จ๐ฑ ๐๐ฑ๐๐ฌ
Whenever we work with flexbox,we always deal with two axex,which are following.
๐. ๐๐๐ข๐ง ๐๐ฑ๐๐ฌ
๐. ๐๐ซ๐จ๐ฌ๐ฌ ๐๐ฑ๐๐ฌ
Some of the properties of flex Box are following.
flex-direction:row;
flex-direction:row-reverse;
flex-direction:column;
flex-direction:column-reverse;
justify-content:center;
align-item:center;