gpt4 book ai didi

CSS block 向左浮动

转载 作者:太空宇宙 更新时间:2023-11-03 22:07:18 25 4
gpt4 key购买 nike

我有这个html文件

    <div class="con" style="width:100px;height:200px;">
1
</div>
<div class="con" style="width:100px;height:200px;">
2
</div>
<div class="con" style="width:100px;height:400px;">
3
</div>
<div class="con" style="width:100px;height:400px;">
4
</div>
<div class="con" style="width:100px;height:100px;">
5
</div>
<div class="con" style="width:100px;height:100px;">
6
</div>
<div class="con" style="width:100px;height:100px;">
7
</div>
<div class="con" style="width:100px;height:100px;">
8
</div>

我希望这个 html 有这个结果: Html result

但是我写了这个 css:

<style>
body {
width:440px;
height:440px;
}
.con{
float:left;
background:#bebebe;
margin:1px;
}
</style>

我得到了这个结果! :-( enter image description here

我重复一遍,我将只使用我编写的 html 代码得到第一张图片的结果。

最佳答案

bodywidth 更改为 408px; 然后 float:right; div 3 & 4 .

演示: http://jsbin.com/imire5

向左浮动的更新演示: http://jsbin.com/imire5/2

关于CSS block 向左浮动,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4889230/

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