CSS写水滴特效,里面可加图标
代码如下(示例):
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="drop.css">
</head>
<body>
<div class="drop"><ion-icon></ion-icon></div>
//里面可以自己加icon
</body>
</html>
CSS部分
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
display: flex;
justify-content: center;
align-items: center;
min-height: 100vh;
min-width: 100vw;
background: #eee;
}
.drop {
position: relative;
width: 150px;
height: 150px;
box-shadow: inset 10px 10px 10px rgba(0, 0, 0, .05),
15px 25px 10px rgba(255, 255, 255, .05),
15px 20px 20px rgba(0, 0, 0, .05),
inset -10px -10px 15px rgba(255, 255, 255, .9);
border-radius: 50%;
display: flex;
justify-content: center;
align-items: center;
}
.drop::before {
content: '';
position: absolute;
top: 35px;
left: 25px;
width: 20px;
height: 20px;
border-radius: 50%;
background: #fff;
}
.drop::after {
content: '';
position: absolute;
top: 25px;
left: 50px;
width: 10px;
height: 10px;
border-radius: 50%;
background: #fff;
}
版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 举报,一经查实,本站将立刻删除。
文章由极客之音整理,本文链接:https://www.bmabk.com/index.php/post/79727.html