Make a simple yet beautiful div using only HTML/CSS
Hey guys once again welcome to the Decoders blog, I hope you all are doing well and today I'm present with a designed div(using css/html).
First of all make a simple HTML boiler plate as given below
<!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>Design</title>
<link rel="stylesheet" href="style.css">
</head>
<body>
<div class="design">
<p id="text">WELCOME</p>
</div>
</body>
</html>
Then use the given below css code :
*{
padding: 0px;
margin: 0px;
}
.design{
height: 213px;
position: fixed;
width: 41%;
left: 411px;
top: 26%;
background-image: url(203536.png);
background-position: center;
background-size: contain;
border-radius: 10px;
}
#text{
text-align: center;
position: absolute;
font-weight: bold;
font-size: large;
left: 40%;
top: 44%;
color: white;
}
.design:hover{
width: 43%;
height: 219px;
transition:ease-in-out;
backdrop-filter: blur(13px);
border-radius: 20px;
transition-duration: 0.9s;
box-shadow: 13px 10px 17px #222a25c7;
animation-duration: 4s;
animation-name: design;
animation-timing-function: linear;
animation-iteration-count: infinite;
}
#text:hover{
font-size: 30px;
position: absolute;
background-color: rgb(255 255 255 / 42%);
border-radius: 22px;
/* width: 252px;
left: 40%; */
transition-duration: 2s;
}
@keyframes design{
0%{
background-position: center;
width: 41%;
height: 213px;
}
25%{
background-position-y:-20px;
width: 42%;
height: 216px;
}
50%{
background-position-y:-40px;
width: 43%;
height: 219px;
}
75%{
background-position-y:-20px;
width: 42%;
height: 216px;
}
100%{
background-position: center;
width: 41%;
height: 213px;
}
}
Comments
Post a Comment