Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/70.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 iFrame使用来自主体的背景图像_Html_Css_Iframe_Background Color - Fatal编程技术网

Html iFrame使用来自主体的背景图像

Html iFrame使用来自主体的背景图像,html,css,iframe,background-color,Html,Css,Iframe,Background Color,我有一个页面,上面有几个iFrame,它们自己刷新,显示某些数据。问题是背景图像本身也设置在iframe背景上。iframe页面链接到与主页相同的CSS文件,但是我有使用不同id和类的页面,但是背景图像仍然显示在iframe中。在主机页上,我有一个CSS文件,说明背景的图像文件 body { background-image: url (background1.jpg); } iFrame看起来是这样的: <iframe src="File.php" width="100px" heig

我有一个页面,上面有几个iFrame,它们自己刷新,显示某些数据。问题是背景图像本身也设置在iframe背景上。iframe页面链接到与主页相同的CSS文件,但是我有使用不同id和类的页面,但是背景图像仍然显示在iframe中。在主机页上,我有一个CSS文件,说明背景的图像文件

body {
background-image: url (background1.jpg);
}
iFrame看起来是这样的:

<iframe src="File.php" width="100px" height="100px" frameborder="0"></frame>

我尝试了
allowtransparency
属性,但没有任何效果。我曾尝试在CSS中为iFrame页面本身指定背景色,但它什么也不做。当正文标记设置URL图像时,是否无法更改iFrame页面的背景?

在iFrame中添加属性

style="background-color:SET YOUR COLOR"
在iframe中添加attr

style="background-color:SET YOUR COLOR"

使用相对于iframe的位置

position:relative; z-index:99;

使用相对于iframe的位置

position:relative; z-index:99;

我试过了。它仍然使用背景图像。我已经试过了。它仍然使用背景图像。