首页 > Web开发 > 详细

纯css实现圆柱体

时间:2021-08-05 10:31:59      阅读:19      评论:0      收藏:0      [点我收藏+]
<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <title>css实现圆柱体</title>
    <style>
        .lui-column-bg {
            position: relative;
            width: 50px;
            height: 90px;
            margin: 100px auto;
            background-color: transparent;
            background-color: rgba(0, 199, 159, 0.2);
        }
        .lui-column-bg:before {
            position: absolute;
            content: ‘‘;
            display: block;
            height: 20px;
            width: 100%;
            border-radius: 50%;
            top: -10.5px;
            z-index: 1;
            background-color: rgb(101 221 197);
        }

        .lui-column-bg:after {
            position: absolute;
            content: ‘‘;
            display: block;
            height: 15px;
            width: 100%;
            border-radius: 50%;
            bottom: -10px;
            background-color: rgb(0, 255, 204);
        }

        .lui-inner {
            position: absolute;
            bottom: 0;
            width: 100%;
            height: 50%;
            background-image: linear-gradient(to top, rgb(0, 255, 204), rgb(0, 199, 159));
            text-align: center;
        }
        .lui-inner::before {
            position: absolute;
            content: ‘‘;
            display: block;
            height: 20px;
            width: 100%;
            background-color: rgb(0, 199, 159);
            border-radius: 50%;
            top: -10.5px;
            z-index: 1;
        }
        .lui-inner:after {
            position: absolute;
            content: ‘‘;
            display: block;
            height: 15px;
            width: 100%;
            border-radius: 50%;
            background-color: white;
            bottom: -10px;
        }


    </style>
</head>

<body>
    <div id="app">
        <div class="lui-column-bg">
            <div class="lui-inner" style="height: 50%;">
            </div>
        </div>
    </div>

</body>

</html>

效果如下:

技术分享图片

 

纯css实现圆柱体

原文:https://www.cnblogs.com/lin494910940/p/15101341.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!