gpt4 book ai didi

html - float 元素内的 float 元素

转载 作者:行者123 更新时间:2023-11-28 07:21:03 25 4
gpt4 key购买 nike

如果我有下面的布局

<div style='float: left;'>Outer Div </div>
<div style='float: left;'>
<div style='float: left;'>Inner Div </div>
<div style='float: left;'>Inner Div </div>
<div style='float: left;'>Inner Div </div>
<div style='float: left;'>Inner Div </div>
<div style='float: left;'>Inner Div </div>
</div>

当首先调整浏览器大小时,第二个外部 div 将折叠在第一个外部 div 下。只有在那之后,内部 div 才会崩溃。有没有办法让内部 div 在外部 div 折叠之前先折叠?

最佳答案

这有点奇怪。

要执行您想要的操作,我认为您需要使用响应式设计 media 查询。基本上,您可以根据浏览器窗口的宽度给出条件 CSS 规则。

@media only screen and (max-width: 500px) {
body {
background-color: lightblue;
}
}

http://www.w3schools.com/css/css_rwd_mediaqueries.asp

关于html - float 元素内的 float 元素,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32082858/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com