gpt4 book ai didi

Safari 的 CSS 径向渐变不起作用

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

当我在 Chrome、IE 和 Firefox 上使用这段代码时,它工作正常!但在 Safari 上它不起作用。

出现此问题:

enter image description here

.circle-red {
border: 2px solid;
border-radius: 51%;
width: 40px;
height: 40px;
background: radial-gradient(ellipse at 80px 40px, rgba(255, 255, 255, 0.75) 10%, rgba(255,255,255,0.5) 32%, rgba(255,255,255,0) 70% ), linear-gradient(160deg, transparent 10%, red 30%);
background-size: 87.5% 55%, 100% 100%;
background-repeat: no-repeat;
}
<div class="circle-red"></div>

最佳答案

尝试在您的背景大小属性和背景渐变值上添加一个 webkit 前缀。这是一个例子:

.circle-red {
border: 2px solid;
border-radius: 51%;
width: 40px;
height: 40px;
background: radial-gradient(ellipse at 80px 40px, rgba(255, 255, 255, 0.75) 10%, rgba(255,255,255,0.5) 32%, rgba(255,255,255,0) 70% ), linear-gradient(160deg, transparent 10%, red 30%);
background: -webkit-radial-gradient(ellipse at 80px 40px, rgba(255, 255, 255, 0.75) 10%, rgba(255,255,255,0.5) 32%, rgba(255,255,255,0) 70% ), linear-gradient(160deg, transparent 10%, red 30%);
background-size: 87.5% 55%, 100% 100%;
-webkit-background-size: 87.5% 55%, 100% 100%;
background-repeat: no-repeat;
}

关于Safari 的 CSS 径向渐变不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35159884/

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