[英]How to use a single continuous gradient that on affects one side of a table
我想知道是否存在一種“簡單”的方法來僅對表格的一側進行漸變(即:僅最左側的列),而無需單獨進行每個漸變以給出連續的外觀?
因此,在此代碼中,日期應為彩色,顏色應從白色開始,在底部為純色,所有文本應保持白色
請幫忙,否則我整晚頭痛
<table>
<tr>
<td>1990</td>
<td>words and things</td>
<td>more words and things</td>
</tr>
<tr>
<td>2000</td>
<td>no color here</td>
<td>nor color here</td>
</tr>
<tr>
<td>2010</td>
<td>this should be white</td>
<td>and this too</td>
</tr>
<tr>
<td>2020</td>
<td>Oh the places you'll go</td>
<td>the magic that is CSS</td>
</tr>
<tr>
<td>2030</td>
<td>I am but a lowly peon</td>
<td>take pity upon my soul</td>
</tr>
</table>
您可以在此處制作跨瀏覽器的漸變樣式: http : //www.colorzilla.com/gradient-editor/
這里還有一些樣式-用生成器為您創建的內容替換注釋:
tbody tr td:first-child {
/* this will apply to the first cell in each row */
}
tbody tr td:first-child + td {
/* this will apply to the second cell in each row */
}
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.