JAVA日报

好看的按钮样式

 

css

@charset "UTF-8";
* {
padding :0;
margin: 0;
}
body {
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
background-color: #efeeee;
}
.container .box{
display: flex;
justify-content: space-around;
align-items: center;
flex-direction: column;
width: 100px;
height: 140px;
margin: 20px;
cursor: pointer;
}
.container .box .img {
display: flex;
justify-content: center;
align-items: center;
width: 100px;
height: 100px;
border-radius: 20px;
box-shadow: 19px 18px 30px rgba(0, 0, 0, 0.2),
-18px -18px 30px rgba(255, 255, 255, 1);
transition: all 0.2s ease-out;
}
.container .box .img img{
width: 60px;
transition : all 0.2s ease-out;
}
.container .box .img:hover{
box-shadow:0 0 0 rgba(0, 0, 0, 0.2), 0 0 0
rgba(255, 255, 255, 0.8),inset 18px 18px 30px
rgba(0, 0, 0, 0.1),inset -18px -18px 30px
rgba(255, 255, 255, 1);
}
.container .box .img:hover img{
width: 58px;
}

<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
</head>
<link rel="stylesheet" href="css/test.css" type="text/css"/>
<body>
<div class="container">
<div class="box">
<div class="img"><img src="image/apple.jpg" alt="">
<p>apple</p>
</div>
</div>
<div class="box">
<div class="img"><img src="image/apple.jpg" alt="">
<p>apple</p>
</div>
</div>
<div class="box">
<div class="img"><img src="image/apple.jpg" alt="">
<p>apple</p>
</div>
</div>
</div>
</body>
</html>

posted @ 2021-10-25 22:11  我的未来姓栗山  阅读(16)  评论(0编辑  收藏  举报