jquery - 如何使用 CSS 仅对圆的 10% 底部进行着色?

标签 jquery css

如何使用 CSS 为圆的仅 10% 底部着色? enter image description here

最佳答案

最简单的解决方案是使用框阴影作为第二个边框,并使用绝对定位元素作为 10% 填充。

这是片段示例:

  .circle {
      display: inline-block;
      width: 250px;
      height: 250px;
      border-radius: 50%;
      border: 10px solid white;
      text-align: center;
      line-height: 250px;
      overflow: hidden;
      padding: 3px;
      position: relative;
      box-sizing: border-box;
      box-shadow: 0 0 0 10px gray;
      margin: 50px
    }

    .fill {
      background-color: teal;
      height: 10%;
      width: 100%;
      position: absolute;
      bottom: 0;
      left: 0;
    }
<div class="circle">
  <span class="text">text</span>
  <div class="fill"></div>
</div>

  

还有一把 fiddle : https://jsfiddle.net/0ryjh4xd/2/

关于jquery - 如何使用 CSS 仅对圆的 10% 底部进行着色?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40041688/

相关文章:

javascript - jQuery 检查类中的每个元素与其他元素

css - 网络服务器 + Chrome v40 + font awesome 不起作用

javascript - 如何使用 Jquery 更改图像大小并更改下一张/上一张图像?

jQuery fullcalendar 自定义事件

css - Wordpress BB press Css 问题

css - 如何使 Logo 出现在绝对定位图像的顶部?

html - 使用 CSS 将两个 div 叠加显示

css - <address>标签文字对齐?

javascript - jQuery UI Tabs 在选项卡中加载特定链接

c# - jquery datepicker ms ajax updatepanel 在回发后不起作用