Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/71.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 如何使另一个div内的div背景图像响应?_Html_Css_Image_Twitter Bootstrap_Responsive Design - Fatal编程技术网

Html 如何使另一个div内的div背景图像响应?

Html 如何使另一个div内的div背景图像响应?,html,css,image,twitter-bootstrap,responsive-design,Html,Css,Image,Twitter Bootstrap,Responsive Design,虽然我在StackOverflow中尝试了许多主题,但我已经为这个问题挣扎了一段时间,只是想知道是否有人有任何建议 我使用的是Bootstrap3,基本上我想把图像放在容器中,它会随着浏览器窗口的变化而调整大小,内容仍然保留在里面。那么,我如何才能使其响应?提前谢谢你 HTML <div id="special-dishes-section"> <div class="container"> <div class="special-dish

虽然我在StackOverflow中尝试了许多主题,但我已经为这个问题挣扎了一段时间,只是想知道是否有人有任何建议

我使用的是Bootstrap3,基本上我想把图像放在容器中,它会随着浏览器窗口的变化而调整大小,内容仍然保留在里面。那么,我如何才能使其响应?提前谢谢你

HTML

<div id="special-dishes-section">
    <div class="container">
        <div class="special-dishes">
        </div>    <!-- end special-dishes -->
    </div>    <!-- end container -->
</div>    <!-- end special-dishes-section -->
当需要响应时,此属性可帮助您。 有关更多信息,请参阅此链接:


希望它能帮助你。

试试
背景尺寸:封面
背景大小:包含

是要放置在标签或css背景图像中的图像?您可能只想在这个答案中获得更详细的信息。。。举例说明为什么它能解决OP的问题…@LcSalazar,应该是这样的吗?请看我的。当调整浏览器的大小时,背景对于里面的内容来说太小了,我的意思是想要高度自动展开。
#special-dishes-section{
    background: url('../images/special-dishes-bg.jpg') no-repeat center center;
    min-height: 560px;
    padding: 71px 0 65px 0;
    position: relative;
}

.special-dishes{
    background: url('../images/wooden-bg.png') no-repeat center center;
    min-height: 424px;
}
box-sizing: border-box;