好的,所以我之前尝试过几次SO答案,但仍然没有运气

Radio buttons and label to display in same line

Documentation on <FIELDSET> <LABEL> tags instead of using TABLE's?

Keep radio buttons with their labels on line breaks

发生某种奇怪的事情,迫使我的收音机出现异常行为。感谢您对我可以解决此问题的一些帮助/指导!任何帮助表示赞赏。

现场演示:http://iam.colum.edu/students/jordan.max/web-template(2)/index.html

main.html

<div id="container">

    <form action="welcome_get.php" method="get">
        <p class="textHeader"><strong> First Name </strong></p>
        <input name="firstname" type="text" oninvalid="invalidFName(this);" oninput="invalidFName(this);" placeholder="First Name" required />

        <p class="textHeader"><strong> Last Name </strong></p>
        <p> </p>
        <input id="lastName" type="text" oninvalid="invalidLName(this);" oninput="invalidLName(this);" name="lastName" placeholder="Last Name" required />

        <p class="textHeader"><strong> Email </strong></p>
        <input id="emailaddress" type="email" oninvalid="invalidEmail(this);" name="emailaddress" placeholder="anything@example.com"  required />

        <fieldset>
            <div class="some-class">
                <input type="radio" class="radio" name="x" value="y" id="y" />
                <label for="y">Thing 1</label>
                <input type="radio" class="radio" name="x" value="z" id="z" />
                <label for="z">Thing 2</label>
            </div>
        </fieldset>

        <input type="submit" value="Submit" id="submitButton" />

    </form>

</div>


的CSS

最佳答案

您的样式表中包含以下内容:

#container input, #container select, #container textarea {
    width: 450px;
    border: 1px solid #CEE1E8;
    margin-bottom: 20px;
    padding: 4px;
}


width: 450px;排除了无线电字段的布局。您可以尝试在该语句后添加类似以下内容,以将其覆盖为收音机:

#container input[type=radio] {
    width: auto;
}

09-17 15:38
查看更多