CSS style = display:block not working

raj*_*eev 3 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;">
            <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>
Run Code Online (Sandbox Code Playgroud)

一切都在一行显示.我不知道如何在单选按钮下显示文本框,中间有一些空格.?

帮助.

小智 13

你的风格问题是浮动:左,你必须清除"浮动".在P元素中,包括clear:both,它告诉浏览器没有任何东西可以向左或向右浮动.

<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>
Run Code Online (Sandbox Code Playgroud)