Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/86.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
HTML代码-背景图像_Html_Image_Background Image - Fatal编程技术网

HTML代码-背景图像

HTML代码-背景图像,html,image,background-image,Html,Image,Background Image,我在网页中添加了一些html代码,使背景更加突出。我不得不修改代码,使其在所有浏览器上都能工作,现在我已经破坏了它,有人能告诉我哪里出了问题吗 <tr style= "background-color: #114e64; background-image: -webkit-gradient(linear,0% 0%, 0% 100%, color-stop(0%, #197192), color-stop(100%, #114e64)); background-image: -webkit

我在网页中添加了一些html代码,使背景更加突出。我不得不修改代码,使其在所有浏览器上都能工作,现在我已经破坏了它,有人能告诉我哪里出了问题吗

<tr style=
"background-color: #114e64;
background-image: -webkit-gradient(linear,0% 0%, 0% 100%, color-stop(0%, #197192), color-stop(100%, #114e64));
background-image: -webkit-linear-gradient(#197192,#114e64);
background-image: -moz-linear-gradient(#197192,#114e64);
background-image: -o-linear-gradient(#197192,#114e64);
background-image: linear-gradient(#197192,#114e64);"
height="45">
</tr>


谢谢

这段代码对我来说很好用。 别忘了添加一个td标记以使表格单元格可见。 用您的代码看一下这个JSFIDLE:


测试对象

在这种情况下,请使用

将您的示例转换为类似以下内容以查找错误:

 tr {background-color: #114e64;
 background-image: -webkit-gradient(linear, 0% 0%, 0% 100%,
 color-stop(0%, #197192),
 color-stop(100%, #114e64));
 background-image: -webkit-linear-gradient(#197192, #114e64);
 background-image: -moz-linear-gradient(#197192, #114e64);
 background-image: -o-linear-gradient(#197192, #114e64);
 background-image: linear-gradient(#197192, #114e64);
}
一旦检查出来,您可以将其转换回当前HTML标记的样式属性。

您应该使用(表列)标记使其工作

<table>
<tr>
<td style="background-color:#114e64;
background-image: -webkit-gradient(linear,0% 0%, 0% 100%, color-stop(0%, #197192), color-stop(100%, #114e64));
background-image: -webkit-linear-gradient(#197192,#114e64);
background-image: -moz-linear-gradient(#197192,#114e64);
background-image: -o-linear-gradient(#197192,#114e64);
background-image: linear-gradient(#197192,#114e64);"
height="45">
</tr>
</table>


以何种方式损坏?浏览器坏了,页面坏了?电脑坏了O对我来说很好>>我认为操作代码是正确的。它成功地通过了验证器(当然,供应商扩展的警告消息除外)。我的意图不是分发一条鱼,而是用来捕获一条鱼的工具。如果这值得一票否决,那就这样吧。
<table>
<tr>
<td style="background-color:#114e64;
background-image: -webkit-gradient(linear,0% 0%, 0% 100%, color-stop(0%, #197192), color-stop(100%, #114e64));
background-image: -webkit-linear-gradient(#197192,#114e64);
background-image: -moz-linear-gradient(#197192,#114e64);
background-image: -o-linear-gradient(#197192,#114e64);
background-image: linear-gradient(#197192,#114e64);"
height="45">
</tr>
</table>