gpt4 book ai didi

css - float 问题

转载 作者:行者123 更新时间:2023-11-27 22:29:40 25 4
gpt4 key购买 nike

我正在努力使布局看起来像以下(粗略的)模型 lol:

--div----------------
|标签文本框 |
|标签文本框 |
|标签文本框 |
|-------------------- |

这是我的……

.personalInfo_Form
{
width:600px;
margin: auto;
padding: 20px;
background-color: White;
}

.addressLabel
{
float: left;
width: 140px;
padding: 5px;
text-align: right;
}

.addressField
{
float: left;
padding: 5px;
}

在 FireFox 中查看的最终结果是行偏移且不统一。我注意到指定一个非常具体的 div 宽度可以改变 position 的结果,这是有道理的,因为它会强制执行默认情况下元素不能重叠的 float 规则,从而将它们定位在另一个之下......但是,我想设计它使得 Div 的宽度不是内部元素定位的一个因素。

为帮助干杯!

最佳答案

clear: both;clear: left; 添加到你的 .addressLabel 样式中。您必须通过 float 包含的 div 或提供 clearfix 来确保 div 在 float 元素之外继续。

关于css - float 问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4116874/

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