美文网首页
同心圆的实现

同心圆的实现

作者: 小漠穷秋 | 来源:发表于2017-12-05 14:42 被阅读0次

    涉及知识:
    1.z-index 和 opacity混用
    2.垂直居中
    3.border-radius

    代码:
    html:
    <div class="panel-card>
    <div class="big"></div>
    <div class="middle"></div>
    <div class="small"></div>
    </div>
    css:
    .panel-card{
    float: left;
    width: 50%;
    height: 100%;
    position: relative;
    }
    .panel-card .big{
    display: inline-block;
    width: 100px;
    height: 100px;
    opacity: 0.1;
    position: absolute;
    margin: auto;
    top: 0; left: 0; bottom: 0; right: 0;
    background: #00B39E;
    border-radius: 50px;
    }
    .panel-card .middle{
    display: inline-block;;
    width: 50px;
    height: 50px;
    position: absolute;
    margin: auto;
    top: 0; left: 0; bottom: 0; right: 0;
    background: #00B39E;
    border-radius: 25px;
    }
    .panel-card .small {
    display: inline-block;
    width: 20px;
    height: 20px;
    position: absolute;
    margin: auto;
    top: 0; left: 0; bottom: 0; right: 0;
    border-radius: 10px;
    background-color: #ffffff;
    }

    实现效果:

    image.png

    相关文章

      网友评论

          本文标题:同心圆的实现

          本文链接:https://www.haomeiwen.com/subject/uhkcixtx.html