Css圆环

作者: w_wx_x | 来源:发表于2019-08-05 20:01 被阅读0次
圆环.png
1.两个标签嵌套
<style type="text/css">
    .parent{
        width: 120px;
        height: 120px;
        border-radius: 50%;
        background-color: #000;
        position: relative;
    }
    .child{
        width: 100px;
        height: 100px;
        border-radius: 50%;
        background-color:#fff;
        position: absolute;
        top: 10px;
        left: 10px;
    }
</style>
<div class="parent">
    <div class="child"></div>
</div>
2.伪元素,before、after
<style type="text/css">
    .parent{
        width: 120px;
        height: 120px;
        border-radius: 50%;
        background-color: #000;
    }
    .parent::before{
        content: '';
        display: inline-block;
        width: 100px;
        height: 100px;
        border-radius: 50%;
        background-color: #fff;
        position: relative;
        top: 10px;
        left: 10px;
    }
    .child{
        width: 100px;
        height: 100px;
        border-radius: 50%;
        background-color:#fff;
        position: absolute;
        top: 10px;
        left: 10px;
    }
</style>
<div class="parent">
</div>
3.border
<style type="text/css">
    .parent{
        width: 100px;
        height: 100px;
        border-radius: 50%;
        background-color: #fff;
        border: 10px solid #000;
    }
</style>
<div class="parent">
</div>
4.box-shadow
<style type="text/css">
    .parent{
        width: 100px;
        height: 100px;
        background-color: #fff;
        border-radius: 50%;
        box-shadow: 0 0 0 10px #000 ;
    }
</style>
<div class="parent">
</div>
5.radial-gradient
<style type="text/css">
    .parent{
        width: 120px;
        height: 120px;
        border-radius: 50%;
        background: -webkit-radial-gradient( circle closest-side,#009966 90%,lightpink 10%)
    }
</style>
<div class="parent">
</div>

相关文章

  • Css圆环

    1.两个标签嵌套 2.伪元素,before、after 3.border 4.box-shadow 5.radia...

  • CSS圆环样式

    文/王乐生 最近重新开始接触CSS,挑战了一下用CSS代码拼出这样的一个效果。 先附上效果图 HTML代码块 CS...

  • css实现loading圆环

    一、实现思路 四分之一圆弧 旋转动画 戳我获取完整源码 ? 二、画四分之一圆弧 2.1 border方案 css部...

  • CSS3实现圆环内阴影效果

    这是一个关于CSS3灵活应用的例子,圆环的内阴影效果。比如说,我想做一个根据加载进度不同圆环动态填充的效果,如下图...

  • CSS 实现七彩圆环loading动画

    前言 ?CSS 实现七彩圆环loading动画,速速来Get吧~ ?文末分享源代码。记得点赞+关注+收藏! 1.实...

  • iOS_动画_实例(2)_进度条的实现+渐变进度条的实现

    一丶原理 先看下效果: 无渐变: 由2个圆环,一个背景灰色圆环+一个进度圆环; 1.圆环 CAShapeLayer...

  • clip实现圆环进度条

    怎么实现这样一个圆环进度条的效果呢,可以使用canvas、svg、GIF等等方式,今天我们来说下使用css3怎么来...

  • 【iOS】带端点的进度圆环

    效果如图: 根据项目需求,实现了以上效果的圆环;对于圆环,主要分三层:1.最底层灰色圆环;2.上层的进度圆环;3....

  • SVG 绘制非完整渐变圆环

    本文主要想谈一谈前端关于渐变圆环的制作,效果图如下: 注意:部分iphone 不支持css3旋转大于等于90度,故...

  • Tower of Hanoi

    有 A、B、C 三根柱子 当前 A 柱套了 n 个圆环 由上至下这 n 个圆环的直径依次变大 要将所有圆环从 A ...

网友评论

      本文标题:Css圆环

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