如何使我的DIV在彼此下面显示 [英] How can I make my DIVs appear below each other
本文介绍了如何使我的DIV在彼此下面显示的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有以下:
< div style =float:left; padding-right:1% >
< label class =editor-labelfor =BrowserTitle>浏览器标题< / label>
< input class =editor-fieldid =BrowserTitlename =Question.BrowserTitlesize =30type =textvalue =Test title/>
< / div>
我想让输入字段出现在标签下面。现在它只是跟在同一行上的标签。有没有办法,我可以用CSS做到这一点?
解决方案
设置
显示:block;
$ b p> 注意:如同注释中所指出的,您还需要从包含div的 float
样式中删除 divs 。
I have the following:
<div style="float: left; padding-right: 1%;">
<label class="editor-label" for="BrowserTitle">Browser Title</label>
<input class="editor-field" id="BrowserTitle" name="Question.BrowserTitle" size="30" type="text" value="Test title" />
</div>
I want to make the input field appear below the label. Right now it just follows the label on the same line. Is there a way that I can do this with CSS?
解决方案 Set
display: block;
on either the label or the input.
Note: As pointed out in a comment, you'd also need to remove the float
style from your containing div if you want the divs to appear below each other.
这篇关于如何使我的DIV在彼此下面显示的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文