Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/80.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

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/css/37.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_Css_Background_Background Image - Fatal编程技术网

Html 允许背景溢出?

Html 允许背景溢出?,html,css,background,background-image,Html,Css,Background,Background Image,我的背景如下: 麻烦的是,我想将包含框的宽度设置为只覆盖到白色区域的末端&因此阴影应该“溢出”。我不想使用外容器或填充物,因为我试图避免额外的宽度;如果背景溢出,则浏览器不会创建水平;这个和那个的滚动条正是我想要的 有什么方法可以实现这一点,或者我会被迫使用全宽吗?在上的背景不会影响滚动条,因此根据您需要的阴影,您可能可以执行类似的操作 body { background: url(http://i.stack.imgur.com/ftW5z.png) no-repeat center

我的背景如下:

麻烦的是,我想将包含框的宽度设置为只覆盖到白色区域的末端&因此阴影应该“溢出”。我不想使用外容器或填充物,因为我试图避免额外的宽度;如果背景溢出,则浏览器不会创建水平;这个和那个的滚动条正是我想要的

有什么方法可以实现这一点,或者我会被迫使用全宽吗?

上的背景不会影响滚动条,因此根据您需要的阴影,您可能可以执行类似的操作

body {
    background: url(http://i.stack.imgur.com/ftW5z.png) no-repeat center top;
    margin: 0;
}
.container {
    width: 1014px; /* inner space of shadow image */
    margin: 35px auto; /* 35px matches size of top shadow */
}
演示


您可以使用另一个容器并使用“最小宽度”和“溢出隐藏”来实现相同的效果。

Hmmmm。。。。我有另一个图像集作为身体背景,但你刚刚给了我一个想法,也许包括作为背景图像的一部分;虽然不是很理想。