html - 设计垂直线

标签 html css

我想制作一条垂直线,如下所示:

http://i41.tinypic.com/2na44n7.png

我试过下面的代码:

div.vertical-line{
    float:right;
    width:5px;
    background-color:black;
    margin-right:20px;
    background: #FFFFFF;
    background: -webkit-gradient(linear, 0 0, 0 bottom, from(#FFFFFF), to(#CFCFCF));
    background: -webkit-linear-gradient(#FFFFFF, #CFCFCF);
    background: -moz-linear-gradient(#FFFFFF, #CFCFCF);
    background: -ms-linear-gradient(#FFFFFF, #CFCFCF);
    background: -o-linear-gradient(#FFFFFF, #CFCFCF);
    background: linear-gradient(#FFFFFF, #CFCFCF);
    -pie-background: linear-gradient(#FFFFFF, #CFCFCF);
    behavior: url(/pie/PIE.htc);
}

但结果并不如预期。 这是结果: http://jsfiddle.net/rLyyc/

它很接近,但它不会在行尾“淡出”。

有什么建议吗?

提前致谢!

最佳答案

使用 this generator ,我为你准备了这个:

background: #ffffff; /* Old browsers */
background: -moz-linear-gradient(top,  #ffffff 0%, #c6cbd2 50%, #ffffff 100%); /* FF3.6+ */
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#ffffff), color-stop(50%,#c6cbd2), color-stop(100%,#ffffff)); /* Chrome,Safari4+ */
background: -webkit-linear-gradient(top,  #ffffff 0%,#c6cbd2 50%,#ffffff 100%); /* Chrome10+,Safari5.1+ */
background: -o-linear-gradient(top,  #ffffff 0%,#c6cbd2 50%,#ffffff 100%); /* Opera 11.10+ */
background: -ms-linear-gradient(top,  #ffffff 0%,#c6cbd2 50%,#ffffff 100%); /* IE10+ */
background: linear-gradient(to bottom,  #ffffff 0%,#c6cbd2 50%,#ffffff 100%); /* W3C */
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#ffffff', endColorstr='#ffffff',GradientType=0 ); /* IE6-9 */

关于html - 设计垂直线,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18405703/

相关文章:

html - div 中的中心文本,其中有一个 div

css - 如何使争鸣与 body 平等

JavaScript:将递增的数字添加到名称属性

javascript - 多个模态只能关闭1个

javascript - HTML 和 JQuery : How to create slideshow of images or text?

html - 使用此代码的粘性页脚?

html - 不使用多个 div 的 CSS 列?

javascript - 将 png 叠加图像放在文本链接上的鼠标悬停上

javascript - 在另一个带有 class 的 SVG 元素之前插入 SVG 元素

html - CSS 下拉菜单在页面刷新时消失