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 CSS背景图像被h2元素替换_Html_Css_Twitter Bootstrap - Fatal编程技术网

Html CSS背景图像被h2元素替换

Html CSS背景图像被h2元素替换,html,css,twitter-bootstrap,Html,Css,Twitter Bootstrap,我使用CSS中的background image属性设置了一个背景图像。通过页面的大部分内容,它可以完美地工作。但是,当它到达某个元素时,背景图像不会显示在为定义的整个区域中 我怎样才能解决这个问题 html{ 背景图像:url(“https://wallpaperscraft.com/image/city_hong_kong_night_clouds_lights_58330_3840x2160.jpg"); } 丁斯通 标题 它不是h2,而是主体标签(ID为#b-overrid

我使用CSS中的
background image
属性设置了一个背景图像。通过页面的大部分内容,它可以完美地工作。但是,当它到达某个
元素时,背景图像不会显示在为
定义的整个区域中

我怎样才能解决这个问题

html{
背景图像:url(“https://wallpaperscraft.com/image/city_hong_kong_night_clouds_lights_58330_3840x2160.jpg");
}

丁斯通
标题

它不是
h2
,而是
主体
标签(ID为
#b-override

添加以下CSS:

body#b-override {
  background: transparent;
}
html{
背景图像:url(“https://wallpaperscraft.com/image/city_hong_kong_night_clouds_lights_58330_3840x2160.jpg");
}
车身#b-超驰控制{
背景:透明;
}

丁斯通
标题

它不是
h2
,而是
主体
标签(ID为
#b-override

添加以下CSS:

body#b-override {
  background: transparent;
}
html{
背景图像:url(“https://wallpaperscraft.com/image/city_hong_kong_night_clouds_lights_58330_3840x2160.jpg");
}
车身#b-超驰控制{
背景:透明;
}

丁斯通
标题

您的h2可能有背景色。检查该元素的样式。从h2中删除边距,并在必要时使用填充替换它。
h2#页眉{margin top:0px;}
您的h2可能有背景色。检查该元素的样式。从h2中删除margin,并在必要时用padding替换它。
h2#header{margin top:0px;}
另请注意:w3.org建议“作者指定BODY元素的背景,而不是HTML元素。”--另请注意:w3.org建议“作者指定BODY元素而不是HTML元素的背景。”--