Html 当一个body标签响应时,它的css将进入Iframe
我有一个项目在这里,我只能改变CSS我不能触摸html或js。 以下是我的片段: 身体{ 保证金:0; 填充:0; 身高:100%; 溢出:隐藏; 背景:15487F url'background2.jpg'左上角repeat-x; } @媒体屏幕和最小宽度:533px,最大宽度:568px{ 身体{ 背景:15487F url'background2.jpg'左上角repeat-x;} }Html 当一个body标签响应时,它的css将进入Iframe,html,css,iframe,Html,Css,Iframe,我有一个项目在这里,我只能改变CSS我不能触摸html或js。 以下是我的片段: 身体{ 保证金:0; 填充:0; 身高:100%; 溢出:隐藏; 背景:15487F url'background2.jpg'左上角repeat-x; } @媒体屏幕和最小宽度:533px,最大宽度:568px{ 身体{ 背景:15487F url'background2.jpg'左上角repeat-x;} } 使用CSS3,您可以使用以下语法排除iframe id: @media screen and (min-
使用CSS3,您可以使用以下语法排除iframe id:
@media screen and (min-width: 533px) and (max-width:568px) {
body :not(#hmnavigation) {
background: #15487F url('background2.jpg') top left repeat-x;
}
}
否则,可以在body元素中已声明的背景属性上强制使用iframe id:
#hmnavigation {
background: url('background.jpg');
}
编辑:请参见下面的注释body:nothmnavigation表示没有id hmnavigation的body元素。id hmnavigation在iframe上,而不是body上。对@Quentin,我忘记了body和:not not notation之间的空格。