我想将<ul>元素的右边框设置为线性渐变。
我尝试了以下代码,但都没有成功:
-webkit-border-image: -webkit-linear-gradient(top, #FE2EF7, #4AC0F2) 0 0 5px;
我正在使用Chrome浏览器。
非常感谢。
我想将<ul>元素的右边框设置为线性渐变。
我尝试了以下代码,但都没有成功:
-webkit-border-image: -webkit-linear-gradient(top, #FE2EF7, #4AC0F2) 0 0 5px;
我正在使用Chrome浏览器。
非常感谢。
这个问题有解决方案,但我不确定你是否能调整边框宽度:http://jsfiddle.net/u2ZE4/1/
-webkit-border-image: -webkit-gradient(linear, left top, left bottom, from(#e00), to(#fff))0 100% 0 0 stretch;
border-width
属性来调整边框宽度。感谢您的坚持 :) 来自波斯尼亚的问候! - daniel.tosabahttp://jsfiddle.net/fkFec/1102/
<div class="g">
<div>bla</div>
</div>
.g {
border-right-width:1px;
-webkit-border-image: -webkit-gradient(linear, 0 0, 0 100%, color-stop(0, transparent), color-stop(0.5, grey), color-stop(0.5, grey), color-stop(1, transparent)) 0 100%;
border-right-width: 1px;
border-left-width: 0px;
border-top-width: 0px;
border-bottom-width: 0px;
padding: 2px;
width: 400px;
height: 150px;
margin: 10px auto;
}
以上两个选项对我都不起作用,但以下代码有效:
对于右边框:
.right-gradient-bdr{
border-width: 1px;
border-style: solid;
border-left:0;
border-image:
linear-gradient(rgba(0,0,0,0), rgba(0,0,0,1), rgba(0,0,0,0)) 0 100%;
}
对于底部边框:
.bottom-gradient-bdr{
border: 0px;
border-bottom: 1px solid;
border-image: linear-gradient(to right, rgba(0, 0, 0, 0), rgba(0, 0, 0, 1), rgba(0, 0, 0, 0));
border-image-slice: 1;
}