HTML对齐问题
我知道这个问题有很多类似的帖子: 等 但在本例中,我将第一个文本框和单词对齐在一条直线上,但当我试图找出如何为其他文本框和单词对齐时,我得到了以下结果: 当我清除浮动时,这是我的结果: 如何修复css/html,使每个部分在一行上对齐 我尝试过br p div元素和其他元素。请帮忙。谢谢 这是我的html/css:HTML对齐问题,html,css,Html,Css,我知道这个问题有很多类似的帖子: 等 但在本例中,我将第一个文本框和单词对齐在一条直线上,但当我试图找出如何为其他文本框和单词对齐时,我得到了以下结果: 当我清除浮动时,这是我的结果: 如何修复css/html,使每个部分在一行上对齐 我尝试过br p div元素和其他元素。请帮忙。谢谢 这是我的html/css: <div class="section"> <a href="html_images.asp" target="_blank">Create New
<div class="section"> <a href="html_images.asp" target="_blank">Create New
Meeting</a>
<a href="html_images.asp" target="_blank">View All Current Meetings</a>
</div>
<div class="bottom">
<a class="trigger_popup_fricc">Edit Account Settings</a> </div>
<div class="hover_bkgr_fricc">
<span class="helper"></span>
<div>
<div class="popupCloseButton">X</div>
<p>Current Employee Information<br />
<h5 style="color:#000066">Employee ID: 835969</h5>
<h5 style="color:#000066">Employee Name: Maria Sanchez</h5>
<h5 style="color:#000066"> Current Email Address: mmarie3@rrms.com</h5>
<h5 style="color:#000066; float:left;margin-right:10px;"> Update Email Address: </h5><input type="text" name="CurrentEmail" style="float:left; " value="mmarie3@rrms.com"><br>
<h5 style="color:#000066; float:left;margin-right:10px;">Current Password:</h5> <input type="text" style="float:left;" name="PasswordCurr" value="********"><br>
<h5 style="color:#000066; float:left;margin-right:10px;"> Update Password:</h5> <input type="text" style="float:left;" name="UpdatePass" value=" "><br>
<h5 style="color:#000066; float:left;margin-right:10px;"> Confirm New Password:</h5> <input type="text" style="float:left;" name="ConfirmPass" value=" "><br>
<a href="#" class="myButton"><h6 style="color: whitesmoke">Submit</h6></a>
</div>
</div>
不要尝试使用
来获取新行,而是使用clearfix样式将每个
和
包装在一个div中
我对样式做了一些更新,使h5
标签行带有输入
,并在div的
.clearfix{
边缘底部:10px;
}
.clearfix:之后{
内容:'';
显示:块;
明确:两者皆有;
}
您需要清除浮动。我添加了一张图片,显示了我清除浮动时发生的情况。HTML中的
没有结束斜杠,而且从来没有结束斜杠。@Rob well实际上。。。。XHTMLlife@Zze是的,如果您阅读任何实际的HTML规范,那么从一开始,您就永远不会找到其中任何一个指定使用结束斜杠。这包括你的链接答案。@Rob好的,当然不需要了,我只是把它作为一种习惯放在那里作为自动关闭标签,感觉它没有伤害我,我就把它留下。你是否也在一句话的末尾加了一个句号,因为它不会造成任何伤害?如果不是,为什么要对HTML这样做,因为它最终被浏览器忽略,被认为是标签汤,并且如上链接所述,“有害的”?它不起任何作用,那你为什么把它放在那里?它只在下载时占用空间。