<td>标记中的样式属性在Firefox中不起作用

Ban*_*ram -4 html

我有一个HTML表,我正在尝试使用style属性添加渐变<td>.这适用于IE,但不适用于Firefox,Opera或Chrome.

<td height="100%" width="10%" valign="top"
    style="filter:progid:DXImageTransform.Microsoft.Gradient(startColorStr='#6487DB'??, endColorStr='#003366', gradientType='0');" >
</td>
Run Code Online (Sandbox Code Playgroud)

如何让它在Firefox等中运行?

Stu*_*ows 5

这个:

filter:progid:DXImageTransform.Microsoft.Gradient(startColorStr='#6487DB'??, endColorStr='#003366', gradientType='0');
Run Code Online (Sandbox Code Playgroud)

是IE特定的代码.它不应该在其他浏览器中工作.有关在其他浏览器(支持css3)中执行此操作的方法,请参阅css3please.

编辑: 从我之前发布的链接复制并修改为正确的颜色

  background-color: #6487DB;
  background-image: -webkit-gradient(linear, left top, left bottom, from(#6487DB), to(#003366)); /* Saf4+, Chrome */
  background-image: -webkit-linear-gradient(top, #6487DB, #003366); /* Chrome 10+, Saf5.1+ */
  background-image:    -moz-linear-gradient(top, #6487DB, #003366); /* FF3.6 */
  background-image:     -ms-linear-gradient(top, #6487DB, #003366); /* IE10 */
  background-image:      -o-linear-gradient(top, #6487DB, #003366); /* Opera 11.10+ */
  background-image:         linear-gradient(top, #6487DB, #003366);
            filter: progid:DXImageTransform.Microsoft.gradient(startColorStr='#6487DB', EndColorStr='#003366'); /* IE6–IE9 */
Run Code Online (Sandbox Code Playgroud)