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
Html 容器背景重复-y不工作_Html_Css - Fatal编程技术网

Html 容器背景重复-y不工作

Html 容器背景重复-y不工作,html,css,Html,Css,具有以下html代码: <div id="container"> <div id="container2"> ... </div> </div> 但是#container2中的图像在我向#container添加了“min height:75%”后没有垂直重复 任何建议都将不胜感激 我相信您的container2背景不会重复,因为它没有高度。因此,如果你想让它像container1一样重复,只需给它与cont

具有以下html代码:

<div id="container">
    <div id="container2">
            ...
    </div>
</div>
但是#container2中的图像在我向#container添加了“min height:75%”后没有垂直重复


任何建议都将不胜感激

我相信您的container2背景不会重复,因为它没有高度。因此,如果你想让它像container1一样重复,只需给它与container1相同的最小高度。

我相信你的container2背景不会重复,因为它没有高度。所以,如果你想让它像container1一样重复,只要给它和container1一样的最小高度就行了。

所以我想出来了,下面是我所做的:

#container {
    background: #323232 url(../images/container-bg.png) repeat-y;
    position: relative;
    height: 75%;
}

#container2 {
    background: url(../images/container-bg-right.png) repeat-y right top;
    min-height: 100%;
}

谢谢

所以我想起来了,下面是我所做的:

#container {
    background: #323232 url(../images/container-bg.png) repeat-y;
    position: relative;
    height: 75%;
}

#container2 {
    background: url(../images/container-bg-right.png) repeat-y right top;
    min-height: 100%;
}

谢谢

url返回
403禁止
很抱歉,它现在应该可以工作了,谢谢。url返回
403禁止
很抱歉,它现在应该可以工作了,谢谢。谢谢,我刚刚这么做了;将“最小高度:75%”添加到container2中,但仍然相同。我不认为为元素提供高度或最小高度是垂直重复的必要条件,因为它不需要水平重复。我也有这个问题,我永远无法让图像重复-y!谢谢,我刚刚做到了;将“最小高度:75%”添加到container2中,但仍然相同。我不认为为元素提供高度或最小高度是垂直重复的必要条件,因为它不需要水平重复。我也有这个问题,我永远无法让图像重复-y!感谢您发布解决方案。感谢您发布解决方案。