<分区>
编辑问题以包含 desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem .这将有助于其他人回答问题。
关闭 6 年前。
<分区>
编辑问题以包含 desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem .这将有助于其他人回答问题。
关闭 6 年前。
这里有一个简短的问题,css3 gradient
对我的要求没有帮助。我需要用两种颜色突出显示 td
,左半部分用一种颜色,右半部分用另一种颜色。
输出应该是:
我怎样才能做到这一点?
最佳答案
你需要这样吗? 不知道对不对?
<!DOCTYPE html>
<html>
<head>
<style>
table td {
border: 1px solid black;
background: linear-gradient( to right, #ff9e2c 0%, #ff9e2c 50%, #FF0000 50%, #FF0000 100%);
}
</style>
</head>
<body>
<table>
<tr>
<th>Month</th>
<th>Savings</th>
</tr>
<tr>
<td>January</td>
<td>$100</td>
</tr>
<tr>
<td>Feb</td>
<td>$1000</td>
</tr>
<tr>
<td>March</td>
<td>$10</td>
</tr>
<tr>
<td>April</td>
<td>$110</td>
</tr>
</table>
</body>
</html>
关于html - TD背景有两种颜色,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37782972/