gpt4 book ai didi

css - 没有报告 CSS 错误,但 border-image-source 和 border-image-slice 不产生任何边框图像

转载 作者:行者123 更新时间:2023-11-28 14:57:24 26 4
gpt4 key购买 nike

我正在练习并尝试显示边框图像。我创建了图像,它可以是 found here .

enter image description here

我正在运行 Firefox 60.0.1 64 位。

我检查了开发人员工具中的网络 选项卡,图像加载正常。另外,我的 @supports at-rule 工作得很好。并且没有 CSS 错误。

但是,我根本看不到边框图像。

div {
width: 250px;
height: 120px;
background-image: linear-gradient(90deg, rgba(40, 180, 255, 0.9), rgba(40, 100, 255, 0.9));

font-size: 2em;
font-family: Geneva;

margin: 100px auto 0px auto;
padding: 10px;
}

@supports (border-image-source: url(https://raw.githubusercontent.com/Sathyaish/Practice/master/CSS/images/Border.png)) {
div {
border-image-source: url(https://raw.githubusercontent.com/Sathyaish/Practice/master/CSS/images/Border.png);
border-image-slice: 30%;
border-image-repeat: round;
}
}
<div>This is a nice div.</div>

最佳答案

设置 border 属性为一些宽度:

div {
border: 20px solid orange;
width: 250px;
height: 120px;
background-image: linear-gradient(90deg, rgba(40, 180, 255, 0.9), rgba(40, 100, 255, 0.9));
font-size: 2em;
font-family: Geneva;
margin: 100px auto 0px auto;
padding: 10px;
}

@supports (border-image-source: url(https://raw.githubusercontent.com/Sathyaish/Practice/master/CSS/images/Border.png)) {
div {
border-image-source: url(https://raw.githubusercontent.com/Sathyaish/Practice/master/CSS/images/Border.png);
border-image-slice: 30%;
border-image-repeat: round;
}
}
<div>This is a nice div.</div>

关于css - 没有报告 CSS 错误,但 border-image-source 和 border-image-slice 不产生任何边框图像,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50738785/

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