Flex box in css
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=, initial-scale=1.0">
<title>Flex box in css</title>
<style>
.continer {
width: 100%;
height: 544px;
border: 2px solid gray;
display: flex;
/* Initialize the container as a flex box */
/* flex popertiy for flex container */
/* ( by deafult flex direction is row) */
/* flex-direction: row; */
/* flex-direction: column; */
/* flex-direction: row-reverse; */
/* flex-wrap: wrap; */
/* (Default value of flex-wrap is no-wrap) */
/* flex-flow: wrap row-reverse; */
/* justify-content will justify the content in horizontal direction */
/* justify-content: space-evenly; */
/* justify-content: space-between; */
/* justify-content: center; */
/* justify-content: space-around; */
/* align-item will justify the content in vertical direction */
/* align-items: center; */
/* align-items: flex-end; */
/* align-items: flex-start; */
/* align-items: stretch; */
}
.item {
width: 150px;
height: 150px;
background-color: cyan;
border: 2px solid tomato;
margin: 2px;
padding: 10px;
}
/* Flex properties for a flex item */
#box1 {
/* jis item ka jitna bada order number hoga wo utna hi bad me list me show hoga */
/* order: 2; */
/* flex-grow jina bada number hoga wo utana hi jada bada hoga diplay size ke onusar; aur is me - number ivalid hota he */
/* flex-grow: 2; */
/* flex-shrink: 2; */
/* align-self flex-end se ek particular item ko end me le ga sakte he */
align-self: flex-end;
}
#box2 {
/* flex-grow: 23; */
/* flex-shrink jina bada number hoga wo utana hi jada shota hoga diplay size ke onusar; aur is me - number ivalid hota he */
/* flex-shrink: 12; */
align-self: center;
/* align-self center se ek particular item ko center kar sakte he; */
/* flex-basis: 400px; */
/* when flex-direction is set to row flex-basis: will control width */
/* when flex-direction is set to column flex-basis: will control height */
}
#box3 {
/* order: 10; */
/* flex: grow , shrink flex basis; */
/* flex: 3 5 500px; */
/* by deafult align-self is flex-start; */
align-self: flex-start;
}
</style>
</head>
<body>
<h2>Flex box in css</h2>
<div class="continer">
<div class="item" id="box1">Friest item</div>
<div class="item" id="box2">second item</div>
<div class="item" id="box3">third item</div>
<!-- <div class="item" id="box4">fifth item</div>
<div class="item" id="box5">sixth item</div>
<div class="item" id="box6">sixth item</div> -->
</div>
</body>
</html>
Comments
Post a Comment