gpt4 book ai didi

css - Font Awesome : How to make the background-color out of the shape delimitation transparent?

转载 作者:太空宇宙 更新时间:2023-11-03 19:48:36 25 4
gpt4 key购买 nike

假设我有这个字体很棒的图标:

<i class="fa fa-times-circle pull-right fa-2x" style="background-color: white; color: red;" aria-hidden="true"></i><

body 背景设置为黑色

body {  
background-color: black;
}

我希望界定形状的背景是透明的(比如 body 背景是黑色的,而圆圈内的内部背景是白色的),这真的可能吗?

http://jsfiddle.net/8u39n0sq/

基本上如何避免在形状中心的背景色为白色时出现这个又大又丑的白色正方形?

最佳答案

您可以使用 radial-gradient(white 50%, transparent 50%) 并根据需要调整它。希望,这会有所帮助:)

fiddle :http://jsfiddle.net/8u39n0sq/2/

body{
background:black;
}
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css">

<i class="fa fa-times-circle pull-right fa-2x" style="background: radial-gradient(white 50%, transparent 50%); color: red;" aria-hidden="true"></i>

关于css - Font Awesome : How to make the background-color out of the shape delimitation transparent?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47838824/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com