Html CSS样式=显示:块不工作
浏览器是Firefox 我有15个单选按钮的列表。按如下方式显示后:Html CSS样式=显示:块不工作,html,css,Html,Css,浏览器是Firefox 我有15个单选按钮的列表。按如下方式显示后: <div class="abcd" style="margin-left:10px;"> <form id='some'....> <legend>Select Item type :</legend> <fieldset style="display:block;float:left;"> <i
<div class="abcd" style="margin-left:10px;">
<form id='some'....>
<legend>Select Item type :</legend>
<fieldset style="display:block;float:left;">
<input class="yy" id="sss" type="radio" name="group0" value="aaa"/> ABC
...
</fieldset>
<p>
<input placeholder="Enter Name/Value" name="xxx" id="xxx" size="40" style="display:block;float:left;">
<button type="button" id="xxx" style="width:100;">Process</button>
</p>
</form>
</div>
<input placeholder="Enter Name/Value" name="Name" id="NameID" size="40"
style="clear:both; display:block;"/>
选择项目类型:
基础知识
...
过程
所有内容都显示在一行中。我不知道如何在单选按钮下显示文本框,中间有一些空格
pl帮助。尝试将css规则添加到单选按钮本身。像这样:
<style type="text/css">
.group0
{
display:block;
}
</style>
.0组
{
显示:块;
}
这假设
group0
是包含所有单选按钮的组。当使用float
属性时,必须清除该属性,以便其他元素不会在其旁边浮动。尝试将clear:both
添加到输入框的css中,如下所示:
<div class="abcd" style="margin-left:10px;">
<form id='some'....>
<legend>Select Item type :</legend>
<fieldset style="display:block;float:left;">
<input class="yy" id="sss" type="radio" name="group0" value="aaa"/> ABC
...
</fieldset>
<p>
<input placeholder="Enter Name/Value" name="xxx" id="xxx" size="40" style="display:block;float:left;">
<button type="button" id="xxx" style="width:100;">Process</button>
</p>
</form>
</div>
<input placeholder="Enter Name/Value" name="Name" id="NameID" size="40"
style="clear:both; display:block;"/>
粘贴
<div style="clear:both"></div>
在现场设置之后 您的样式的问题是
浮动:left
,您必须清除“浮动”。
在p
标记中,包括清除:两个,它告诉浏览器任何东西都不能在其左侧或右侧浮动
<div class="abcd" style="margin-left:10px;">
<form id='some'>
<fieldset style="display:block;float:left;">
<input class="yy" id="sss" type="radio" name="group0" value="aaa"/> ABC
<input class="yy" id="sss" type="radio" name="group0" value="aaa"/> ABC
<input class="yy" id="sss" type="radio" name="group0" value="aaa"/> ABC
</fieldset>
<p style="clear:both">
<input placeholder="Enter Name/Value" name="xxx" id="xxx" size="40" style="display:block;float:left;">
<button type="button" id="xxx" style="width:100;">Process</button>
</p>
</form>
</div>
基础知识
基础知识
基础知识
过程
您应该在标签周围使用
标记(如ABC),为什么要将
元素设置为显示:块
?如何在ABC周围添加?同样在输入中,我使用了block,因为我试图在下一行中显示它。