我想实现在调整浏览器窗口大小时,容器div内的框将调整大小并放入其中。目前的容器大小调整工作正常,但我有它的子元素的问题。我尝试了不同的方式,但没有得到期望的结果。响应式设计:当浏览器窗口被调整大小时,如何根据容器div来调整盒子
.container {
position: relative;
width: 21%;
min-width: 262px;
height: 202px;
left: 47px;
top: -164px;
background-color: green;
border-radius: 2px;
box-shadow: 5px 5px 5px #111111;
border-style: solid;
border-color: white;
border-width: 5px;
}
#box_inside_1 {
position: relative;
width: 16%;
min-width: 50px;
height: 50px;
top: -36px;
left: 29px;
background-color: white;
box-shadow: 5px 5px 5px #111111;
border-radius: 2px;
}
#box_inside_2 {
position: relative;
width: 16%;
min-width: 50px;
height: 50px;
top: -105px;
left: 260px;
background-color: white;
box-shadow: 5px 5px 5px #111111;
border-radius: 2px;
}
#box_inside_3 {
position: relative;
width: 16%;
min-width: 50px;
height: 50px;
top: -172px;
left: 515px;
background-color: white;
box-shadow: 5px 5px 5px #111111;
border-radius: 2px;
}
<div class="container">
<div id="box_inside_1"></div>
<div id="box_inside_2"></div>
<div id="box_inside_3"></div>
</div>
HTML代码在哪里? – SVK
@SVK对不起,我刚刚更新了我的问题 – SirGuacamole
如果您想要绘制一些内容或详细说明您的结果,那么期望并不明确,所以它更好。 –