CSS Animarions user profile with media query
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="style.css">
<title>Document</title>
</head>
<body>
<!-- <img class="filter" src="cristi.jpg" alt=""> -->
<!-- <div class="box">
</div> -->
<div class="profile">
<img class="img" src="cristi.jpg" alt="">
<div class="content">
<h3 class="title">Welcome to my profile</h3>
<p class="desc">Lorem ipsum dolor sit amet consectetur adipisicing elit. Illo, eius!</p>
<button class="btn">Follow Me</button>
</div>
</div>
</body>
</html>
//CSS File
/* .filter{ */
/* width: 400px; */
/* filter: brightness(105%); */
/* filter: opacity(10%); */
/* filter: sepia(50%); */
/* filter: hue-rotate(350deg); */
/* } */
/* .filter:hover{
filter: blur(0px);
} */
/* .box{
height: 100px;
width: 100px;
background-color: orangered;
transition: 1s;
}
.box:hover{
transform: rotate(390deg);
} */
body{
font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
}
@media(min-width:550px){
.profile{
display: flex;
width: 400px;
margin: 20px auto;
align-items: center;
gap: 15px;
}
.img{
width: 150px;
height: 200px;
border-radius: 10px;
object-fit: cover;
transition: 1s;
}
.content{
align-items: center;
}
.title{
margin-bottom: 0px;
}
.desc{
margin-top: 5px;
}
.btn{
background-color: black;
color: white;
padding: 16px 24px;
border: 1px solid black;
border-radius: 10px;
font-size: 16px;
transition: 0.5s;
}
.btn:hover{
background-color: rgb(255, 255, 255);
color: rgb(0, 0, 0);
}
.img:hover{
width: 150px;
height: 150px;
border-radius: 50%;
}
}
@media(max-width:550px){
.profile{
/* display: flex; */
width: 400px;
margin: 20px auto;
/* align-items: center; */
/* gap: 15px; */
}
.img{
width: 100px;
height: 100px;
border-radius: 50%;
object-fit: cover;
transition: 1s;
}
.content{
/* align-items: center; */
}
.title{
margin-bottom: 0px;
}
.desc{
margin-top: 5px;
}
.btn{
background-color: black;
color: white;
padding: 16px 24px;
border: 1px solid black;
border-radius: 10px;
font-size: 16px;
transition: 0.5s;
}
.btn:hover{
background-color: rgb(255, 255, 255);
color: rgb(0, 0, 0);
}
.img:hover{
}
}
Output File :-
Comments
Post a Comment