纯HTML、CSS写一个简单的水滴特效,水滴里面可加图标

导读:本篇文章讲解 纯HTML、CSS写一个简单的水滴特效,水滴里面可加图标,希望对大家有帮助,欢迎收藏,转发!站点地址:www.bmabk.com

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

(0)

相关推荐

半码博客——专业性很强的中文编程技术网站,欢迎收藏到浏览器,订阅我们!