Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/css/40.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 google chrome中未设置表格背景图像_Html_Css_Django_Cross Browser - Fatal编程技术网

Html google chrome中未设置表格背景图像

Html google chrome中未设置表格背景图像,html,css,django,cross-browser,Html,Css,Django,Cross Browser,打印页面的html模板: <table style="width:128px;height:293px;background-position:center;" id="human-body" background="{{ STATIC_URL }}images/human.png" border="0"> <tr><td>some data</td></tr> </table> 这是我用来打印图像的html,当我点击打

打印页面的html模板:

<table style="width:128px;height:293px;background-position:center;" id="human-body"  background="{{ STATIC_URL }}images/human.png" border="0">
<tr><td>some data</td></tr>
</table>
这是我用来打印图像的html,当我点击打印按钮时,打印页面预览在Firefox中打开,背景图像是这样的,但是在chrome中图像丢失了。会有什么问题

整个问题是两个浏览器中的打印页面都没有应用背景图像。

尝试以下方法:

<table style="width:128px;height:293px;background-position:center;background-image:url(images/human.png);border:0;" id="human-body">
如果你的css在另一个文件夹中,而你的图像在另一个文件夹中,你可以检查你的目录,然后你可以更改你的URL并在开始处添加../


这可能对你有帮助

使用CSS,而不是一些过时的属性。你在控制台中看到404了吗?@karthikr,控制台的200号404sfirefox可能正在从缓存中加载。检查生成的url是否有效-也就是说,直接从浏览器访问url,然后查看您的意思是现在在两个浏览器中都看不到图像?你知道乌尔都语吗?请在Chrome和Firefox中发布一些关于输出的图像,而Firefox中的打印预览应用背景,如果打印,打印输出没有背景。在Chrome中,预览图像加载并消失,打印输出中没有图像。带有图像的图像在Firefox中,当打印输出被执行时,这会消失。您的css是否位于其他目录或与image相同?两者都来自相同的/static/目录,如static/styles/custom.css和static/images/person.png