css - safari 浏览器的底部边框渐变支持

标签 css browser safari gradient compatibility

有没有办法支持safari浏览器的底部边框渐变,只有safari浏览器不支持

 h2 {
    color: #606060;
    font-size: 40px;
    display: inline-block;
    position: relative;
}
 h2::after {
    content: '';
    position: absolute;
    left: 10%;
    display: inline-block;
    height: 1em;
    width: 80%;
    border-bottom: 3px solid;
    border-image: linear-gradient(to right, #CA49D9, #2452A2);
    border-image-slice: 1;
    opacity: 0.6;
    margin-top: 15px;
}
<h2>How it works</h2>

这是 safari 的输出

enter image description here

最佳答案

我向 0px 添加了其他边框属性(左、右和上),它在所有浏览器中都有效。 这是 fiddle http://jsfiddle.net/Aravi/1da8nx5g/1/

h2 {
    color: #606060;
    font-size: 40px;
    display: inline-block;
    position: relative;
}
 h2::after {
    content: '';
    position: absolute;
    left: 10%;
    display: inline-block;
    height: 1em;
    width: 80%;
    border-bottom: 3px solid;
    border-image: linear-gradient(to right, #CA49D9, #2452A2);
    border-image-slice: 1;
    opacity: 0.6;
    margin-top: 15px;
    border-left: 0px;
    border-right: 0px;
    border-top: 0px;
}
<h2>How it works</h2>

关于css - safari 浏览器的底部边框渐变支持,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51298155/

相关文章:

jquery - “.sort”在 Safari 上不起作用

javascript - IndexedDB 与 iOS 8/Safari

html - 居中 div 元素而不考虑文本对齐方式

css - box-shadow 不显示在 div 元素上

html - 可以使用逗号将带有子类的 CSS 声明应用于多个类吗?

c++ - 从我的应用程序启动网页

web-applications - ios 7 电话 : links not working when web app opened from home screen

html - IE 和 FF 中的内联表和内联 block 问题

html - list-style-type : disc reflects when margin is set to 0px on li of a ul? 在哪里

javascript - 为什么标签名称中允许使用 Unicode?