<bdo id='esLUR'></bdo><ul id='esLUR'></ul>
      <tfoot id='esLUR'></tfoot>

    1. <legend id='esLUR'><style id='esLUR'><dir id='esLUR'><q id='esLUR'></q></dir></style></legend>

      <i id='esLUR'><tr id='esLUR'><dt id='esLUR'><q id='esLUR'><span id='esLUR'><b id='esLUR'><form id='esLUR'><ins id='esLUR'></ins><ul id='esLUR'></ul><sub id='esLUR'></sub></form><legend id='esLUR'></legend><bdo id='esLUR'><pre id='esLUR'><center id='esLUR'></center></pre></bdo></b><th id='esLUR'></th></span></q></dt></tr></i><div id='esLUR'><tfoot id='esLUR'></tfoot><dl id='esLUR'><fieldset id='esLUR'></fieldset></dl></div>
    2. <small id='esLUR'></small><noframes id='esLUR'>

    3. 如何让输入单选元素水平对齐?

      时间:2023-10-20
    4. <small id='nZgEA'></small><noframes id='nZgEA'>

        • <bdo id='nZgEA'></bdo><ul id='nZgEA'></ul>
                <tbody id='nZgEA'></tbody>
              <legend id='nZgEA'><style id='nZgEA'><dir id='nZgEA'><q id='nZgEA'></q></dir></style></legend>
            • <tfoot id='nZgEA'></tfoot>

                <i id='nZgEA'><tr id='nZgEA'><dt id='nZgEA'><q id='nZgEA'><span id='nZgEA'><b id='nZgEA'><form id='nZgEA'><ins id='nZgEA'></ins><ul id='nZgEA'></ul><sub id='nZgEA'></sub></form><legend id='nZgEA'></legend><bdo id='nZgEA'><pre id='nZgEA'><center id='nZgEA'></center></pre></bdo></b><th id='nZgEA'></th></span></q></dt></tr></i><div id='nZgEA'><tfoot id='nZgEA'></tfoot><dl id='nZgEA'><fieldset id='nZgEA'></fieldset></dl></div>

              • 本文介绍了如何让输入单选元素水平对齐?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                问题描述

                我希望这些无线电输入横跨屏幕,而不是一个在另一个之下:

                I want these radio inputs to stretch across the screen, rather than one beneath the other:

                HTML

                <input type="radio" name="editList" value="always">Always
                <br>
                <input type="radio" name="editList" value="never">Never
                <br>
                <input type="radio" name="editList" value="costChange">Cost Change
                

                CSS

                input[type="radio"] {
                    margin-left:10px;
                }
                

                http://jsfiddle.net/clayshannon/8wRT3/13/

                我一直在研究显示属性,并在谷歌上搜索,然后砰(砰?撞?)寻找答案,但还没有找到答案.

                I've monkeyed around with the display properties, and googled, and bang (bung? binged?) for an answer, but haven't found one.

                推荐答案

                在你的情况下,你只需要删除元素之间的换行符(<br> 标签) - input 元素默认是 inline-block (至少在 Chrome 中).(更新示例).

                In your case, you just need to remove the line breaks (<br> tags) between the elements - input elements are inline-block by default (in Chrome at least). (updated example).

                <input type="radio" name="editList" value="always">Always
                <input type="radio" name="editList" value="never">Never
                <input type="radio" name="editList" value="costChange">Cost Change
                

                <小时>

                不过,我建议使用 <label> 元素.这样做时,单击标签也会检查元素.将 <label>for 属性与 <input>id 相关联:(示例)


                I'd suggest using <label> elements, though. In doing so, clicking on the label will check the element too. Either associate the <label>'s for attribute with the <input>'s id: (example)

                <input type="radio" name="editList" id="always" value="always"/>
                <label for="always">Always</label>
                
                <input type="radio" name="editList" id="never" value="never"/>
                <label for="never">Never</label>
                
                <input type="radio" name="editList" id="change" value="costChange"/>
                <label for="change">Cost Change</label>
                

                ..或直接将 <label> 元素包裹在 <input> 元素周围:(示例)

                ..or wrap the <label> elements around the <input> elements directly: (example)

                <label>
                    <input type="radio" name="editList" value="always"/>Always
                </label>
                <label>
                    <input type="radio" name="editList" value="never"/>Never
                </label>
                <label>
                    <input type="radio" name="editList" value="costChange"/>Cost Change
                </label>
                

                您也可以花哨并使用 :checked 伪类.

                You can also get fancy and use the :checked pseudo class.

                这篇关于如何让输入单选元素水平对齐?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                上一篇:单选按钮生成重复的 HTML id-s 下一篇:单选按钮和输入字段

                相关文章

                <i id='4MZGp'><tr id='4MZGp'><dt id='4MZGp'><q id='4MZGp'><span id='4MZGp'><b id='4MZGp'><form id='4MZGp'><ins id='4MZGp'></ins><ul id='4MZGp'></ul><sub id='4MZGp'></sub></form><legend id='4MZGp'></legend><bdo id='4MZGp'><pre id='4MZGp'><center id='4MZGp'></center></pre></bdo></b><th id='4MZGp'></th></span></q></dt></tr></i><div id='4MZGp'><tfoot id='4MZGp'></tfoot><dl id='4MZGp'><fieldset id='4MZGp'></fieldset></dl></div>

                <small id='4MZGp'></small><noframes id='4MZGp'>

                    <bdo id='4MZGp'></bdo><ul id='4MZGp'></ul>

                    <legend id='4MZGp'><style id='4MZGp'><dir id='4MZGp'><q id='4MZGp'></q></dir></style></legend>

                    <tfoot id='4MZGp'></tfoot>