首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >使用fontawsome图层的渐变内圆

使用fontawsome图层的渐变内圆
EN

Stack Overflow用户
提问于 2019-10-14 18:00:51
回答 1查看 42关注 0票数 0

我正在尝试使用font-awsome layers和css来达到与下面的图片相同的效果。我可以实现除了梯度之外的所有东西。有没有可能不使用任何额外的图形?

到目前为止我的代码如下:

代码语言:javascript
复制
<script  src="https://use.fontawesome.com/releases/v5.8.1/js/all.js"></script>
<span class="fa-layers fa-fw fa-7x">
        <i class="far fa-circle progress-circle" ></i>
        <i class="far fa-circle progress-circle-small" data-fa-transform="shrink-8" style="color: white;"></i>
        <i class="fas fa-sync-alt progress-circle-small" data-fa-transform="shrink-12" style="color: white;"></i>
    </span>

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2019-10-14 18:18:38

您可以使用如下所示的伪元素添加它

代码语言:javascript
复制
.custom {
  position: relative;
  z-index: 0;
}

.custom:before {
  content: "";
  position: absolute;
  z-index: -1;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width:1em;
  margin:auto;
  border-radius: 50%;
  background: linear-gradient(to right, blue, red);
  transform:scale(0.9);
}
代码语言:javascript
复制
<script data-search-pseudo-elements src="https://use.fontawesome.com/releases/v5.8.1/js/all.js"></script>
<span class="fa-layers fa-fw fa-7x custom">
    <i class="far fa-circle progress-circle" ></i>
    <i class="far fa-circle progress-circle-small" data-fa-transform="shrink-8" style="color: white;"></i>
    <i class="fas fa-sync-alt progress-circle-small" data-fa-transform="shrink-12" style="color: white;"></i>
</span>

<span class="fa-layers fa-fw fa-4x custom">
    <i class="far fa-circle progress-circle" ></i>
    <i class="far fa-circle progress-circle-small" data-fa-transform="shrink-8" style="color: white;"></i>
    <i class="fas fa-sync-alt progress-circle-small" data-fa-transform="shrink-12" style="color: white;"></i>
</span>

<span class="fa-layers fa-fw fa-2x custom">
    <i class="far fa-circle progress-circle" ></i>
    <i class="far fa-circle progress-circle-small" data-fa-transform="shrink-8" style="color: white;"></i>
    <i class="fas fa-sync-alt progress-circle-small" data-fa-transform="shrink-12" style="color: white;"></i>
</span>

票数 2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/58374383

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档