在 CSS 中动画具有透明背景和边框半径的圆形
您正在尝试绘制具有边框半径的圆形,但是您在覆盖元素同时保持圆圈背景透明时遇到困难。这是因为在旋转过程中隐藏圆的左半部分所必需的遮罩可防止叠加层透明地出现在其他元素上。
原始代码:
<code class="html"><div class="background"> <div class="wrapper"> <div class="pie spinner"></div> <div class="pie filler"></div> <div class="mask"></div> </div> </div></code>
<code class="css">.wrapper .spinner { border-radius: 100% 0 0 100% / 50% 0 0 50%; border-right: none; border-color: red; } .wrapper .filler { border-radius: 0 100% 100% 0 / 0 50% 50% 0; left: 50%; border-left: none; } .wrapper .mask { position: absolute; width: 50%; height: 100%; background: #0000FF; opacity: 1; }</code>
解决方案:
- 为正文设置一个具有重复渐变图案的背景图像,允许透明背景,同时保留视觉兴趣。
<code class="html"> <div id="container"> <div id="halfclip"> <div class="halfcircle" id="clipped"></div> </div> <div class="halfcircle" id="fixed"></div> </div> </code>
<code class="css">body { background: repeating-linear-gradient(45deg, white 0px, lightblue 100px); } #container { width: 200px; height: 200px; border: solid red 1px; } #halfclip { width: 50%; height: 100%; right: 0px; transform-origin: left center; animation-duration: 16s; } .halfcircle { height: 100%; right: 0px; border-radius: 50%; } #clipped { width: 200%; border-top-color: blue; border-left-color: blue; } #fixed { width: 100%; transform: rotate(135deg); animation-delay: 12s; }</code>
以上是如何在 CSS 中创建带有边框半径的透明圆?的详细内容。更多信息请关注PHP中文网其他相关文章!
声明
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn

当他们在2013年去Chrome时,我们失去了歌剧。与Edge今年早些时候也进行了同样的交易。迈克·泰勒(Mike Taylor)称这些变化为“减少

在本周的综述中,Apple进入Web组件,Instagram如何插入脚本以及一些思考的食物,以进行自托管关键资源。


热AI工具

Undresser.AI Undress
人工智能驱动的应用程序,用于创建逼真的裸体照片

AI Clothes Remover
用于从照片中去除衣服的在线人工智能工具。

Undress AI Tool
免费脱衣服图片

Clothoff.io
AI脱衣机

AI Hentai Generator
免费生成ai无尽的。

热门文章
R.E.P.O.能量晶体解释及其做什么(黄色晶体)
1 个月前By尊渡假赌尊渡假赌尊渡假赌
R.E.P.O.最佳图形设置
1 个月前By尊渡假赌尊渡假赌尊渡假赌
刺客信条阴影:贝壳谜语解决方案
2 周前ByDDD
R.E.P.O.如果您听不到任何人,如何修复音频
1 个月前By尊渡假赌尊渡假赌尊渡假赌
R.E.P.O.聊天命令以及如何使用它们
1 个月前By尊渡假赌尊渡假赌尊渡假赌

热工具

适用于 Eclipse 的 SAP NetWeaver 服务器适配器
将Eclipse与SAP NetWeaver应用服务器集成。

安全考试浏览器
Safe Exam Browser是一个安全的浏览器环境,用于安全地进行在线考试。该软件将任何计算机变成一个安全的工作站。它控制对任何实用工具的访问,并防止学生使用未经授权的资源。

Atom编辑器mac版下载
最流行的的开源编辑器

Dreamweaver CS6
视觉化网页开发工具

Dreamweaver Mac版
视觉化网页开发工具