responsiveflexbox
css:---
*{
margin: 0px;
padding: 0px;
box-sizing: border-box;
}
.container{
margin: auto;
/* width: 550px; */
height:200px;
border:2px solid red;
display: flex;
flex-wrap: wrap;
gap: 1em;
/* align-content: space-around; */
/* column-gap: 1em;
row-gap: 1em; */
/* display: flex;
flex-flow:row-reverse wrap; */
/* flex-wrap: wrap; */
/* align-items:stretch; */
/* justify-content: center; */
}
.item1{
flex: 1 0 200px;
/* flex-grow: 3; */
height: 100px;
/* width: 100px; */
background-color: aqua;
/* order: 4; */
}
.item2{
flex: 1 0 200px;
/* order: 3; */
/* flex-grow: 2; */
height: 100px;
/* width: 100px; */
background-color: yellow;
}
.item3{
flex: 1 0 200px;
/* flex-grow: 5;
flex-shrink: 0; */
/* order: 1; */
height: 100px;
/* flex-basis: 200px; */
background-color: green;
}
.item4{
flex: 1 0 200px;
flex-wrap: 2;
/* order: 2; */
height: 100px;
/* width: 100px; */
background-color: blue;
}
img{
height: 100%;
width: 100%;
}
html:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<link rel="stylesheet" href="style/style2.css">
</head>
<body>
<div class="container">
<div class="item1">
<img src="images/img.jpg" alt="">
</div>
<div class="item2">
<img src="images/img1.jpg" alt="">
</div>
<div class="item3">
<img src="images/img2.jpg" alt="">
</div>
<div class="item4">
<img src="images/img3.jpg" alt="">
</div>
</div>
</body>
</html>
Comments
Post a Comment