简体   繁体   English

如何将线性渐变背景应用于 IE9 中的表格行?

[英]How to apply a linear-gradient background to a table row in IE9?

I want to apply a linear-gradient background to a table row.我想将线性渐变背景应用于表格行。

Here's the .css:这是.css:

<style type="text/css">
 .contentBody{
   background-image: -webkit-linear-gradient(left, #95b83d 0%, #abca5e 100%);
   background-image: -o-linear-gradient(left, #95b83d 0%, #abca5e 100%);
   background-image: linear-gradient(to right, #95b83d 0%, #abca5e 100%);
   background-repeat: repeat-x;
   filter: progid:DXImageTransform.Microsoft.gradient (startColorstr='#ff95b83d', endColorstr='#ffabca5e', GradientType=1);
  }
...
</style>

And here's the .html:这是 .html:

<table>
  <tr class="contentBody"> Heading</tr>
    <td></td>
  </tr>
</table>

What I am doing wrong here?我在这里做错了什么? Why the gradient isn't shown?为什么不显示渐变?

well, "Heading" text has to be wrapped with a td like so:好吧,“标题”文本必须像这样用td包裹:

<table>
  <tr class="contentBody"><td>Heading</td></tr>
    <td></td>
  </tr>
</table>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM