Respoonsive flexbox design
Responsive flexbox design
HTML CODE:
<!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">
<link rel="stylesheet" href="try.css">
<title>Document</title>
</head>
<body>
<div class="main love">
<div class="bb b1"></div>
<div class="bb b2"></div>
</div>
<div class="main2 love">
</div>
<div class="fle">
<div class="one box1"></div>
<div class="one box2"></div>
<div class="one box3"></div>
</div>
<div class="muji"></div>
</body>
</html>
CSS code:
*{
margin: 0;
padding: 0;
box-sizing: border-box;
}
html{
font-size: 62.5%;
}
body{
padding: 1rem;
}
.love{
max-width: 1200px;
margin: 0 auto;
}
.main{
display: flex;
height: 200px;
margin-bottom: 50px;
justify-content: space-between;
}
.b1{
background-color: lightcoral;
width: 48%;
border-radius: 15px;
transition: all 0.5s;
}
.b1:hover{
transform: scale(50%,50%);
background-color: aqua;
}
.b2{
background-color: rgb(190, 129, 248);
width: 48%;
border-radius: 15px;
transition: all 0.5s;
}
.b2:hover{
transform: scale(50%,50%);
background-color: lightgray;
}
.main2{
background-color: lightseagreen;
height: 200px;
border-radius: 15px;
margin-bottom: 50px;
transition: all 0.5s;
}
.main2:hover{
transform: scale(120%,120%);
background-color: blueviolet;
}
.fle{
max-width: 1200px;
margin: 0 auto;
height: 200px;
display: flex;
justify-content: space-between;
margin-bottom: 50px;
}
.one{
width: 30%;
border-radius: 15px;
}
.box1{
background: lightpink;
transition: all 0.5s;
}
.box1:hover{
transform: scale(120%,120%);
background-color: goldenrod;
}
.box2{
background: lightgreen;
transition: all 0.5s;
}
.box2:hover{
transform: scale(120%,120%);
background-color: purple;
}
.box3{
background: lightcoral;
transition: all 0.5s;
}
.box3:hover{
transform: scale(120%,120%);
background-color: lightskyblue;
}
.muji{
max-width: 1200px;
height: 400px;
background-color: rgb(247, 111, 111);
margin: 0 auto;
border-radius: 15px;
transition: all 0.5s;
}
.muji:hover{
transform: scale(80%,80%);
background-color: black;
}
@media(max-width:800px){
.fle{
display: block;
/* border: 3px solid black; */
height: 500px;
}
.one{
width: 100%;
height: 33.33%;
margin-bottom: 5px;
}
}
@media(max-width:400px){
.main{
display: block;
height: 300px;
}
.bb{
height: 50%;
width: 100%;
margin-bottom: 5px;
}
}
Comments
Post a Comment