我正在练习并尝试显示边框图像。我创建了图像,可以在这里找到它。
我正在运行64位Firefox 60.0.1。
我检查了开发人员工具中的“网络”选项卡,图像加载正常。我@supports
的规则也很好。而且没有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>
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句