这是小提琴的例子。
我有一个分隔符类:
<div class='seperator-gradient'></div>
我还有一张桌子:
<table class="TABLE">
<tr>
<td></td><td></td><td></td>
</tr>
<tr>
<td></td><td></td><td></td>
</tr>
<tr>
<td></td><td></td><td></td>
</tr>
CSS 文件:
.seperator-gradient{
width: 100%;
height: 1px;
border-bottom:
background: #c4c4c4; /* Old browsers */
background: -moz-linear-gradient(left, #ffffff 0%, #e3e3e3 10%, #b8b8b8 50%, #e3e3e3 90%, #fcfcfc 100%); /* FF3.6+ */
background: -webkit-gradient(linear, left top, right top, color-stop(0%,#ffffff), color-stop(10%,#e3e3e3), color-stop(50%,#b8b8b8), color-stop(90%,#e3e3e3), color-stop(100%,#fcfcfc)); /* Chrome,Safari4+ */
background: -webkit-linear-gradient(left, #ffffff 0%,#e3e3e3 10%,#b8b8b8 50%,#e3e3e3 90%,#fcfcfc 100%); /* Chrome10+,Safari5.1+ */
background: -o-linear-gradient(left, #ffffff 0%,#e3e3e3 10%,#b8b8b8 50%,#e3e3e3 90%,#fcfcfc 100%); /* Opera 11.10+ */
background: -ms-linear-gradient(left, #ffffff 0%,#e3e3e3 10%,#b8b8b8 50%,#e3e3e3 90%,#fcfcfc 100%); /* IE10+ */
background: linear-gradient(to right, #ffffff 0%,#e3e3e3 10%,#b8b8b8 50%,#e3e3e3 90%,#fcfcfc 100%); /* W3C */
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#ffffff', endColorstr='#fcfcfc',GradientType=1 ); /* IE6-9 */
}
.TABLE{
width: 100%;
border-spacing: 0;
border-collapse: collapse;
font-size: 14px;
}
.TABLE TR:nth-child(odd) {
background-color:#f0f0f0;
height: 50px;
}
.TABLE TR:nth-child(even) {
background-color:#fff;
height: 50px;
}
.TABLE TD {
vertical-align: middle;
}
现在我希望表格的边框具有与我在分隔梯度类中实现的功能相同的功能...中间颜色强烈但左右变为较浅的颜色。这可能吗?
顺便说一句,表格的内容是在运行时使用下划线加载的:
<table class="TABLE">
{% _.each(datas,function(c){%}
<tr><td>{{ c.name }}</td>
</tr>
{% });%}
</table>
这就是我想要实现的目标: