html表格中的渐变色

问题描述 投票:-1回答:1

我需要将渐变从“第一”列插入到“三”。 enter image description here

    * {margin:0;padding:0;border:0;border-collapse:collapse;}

table { 
width:100%;
}

th, td {
         border: 2px solid black;
         text-align: center;
}

tbody { 
    background: -webkit-linear-gradient(left, #729fcf 10%, #93971c 10% 20%, #16eab7 20% 35%, #427b70 35%  45%, #861d53 45% 60%, #729fcf 60% 80%, green 0);

    background-attachment:fixed;}

thead tr, thead th { background:transparent; }

http://jsfiddle.net/cpLuye4d/2/

linear-gradients
1个回答
0
投票

渐变显示为带有此代码段的渐变:

-webkit-linear-gradient(left, #729fcf 10%, #93971c 10% 20%, #16eab7 20% 38%, #427b70 38%, #861d53 55%, #729fcf 80%, green 100%)

请注意,每个点只有一个百分比,或者在所有范围内都分配了同质的颜色。

© www.soinside.com 2019 - 2024. All rights reserved.