<small id='VI43E'></small><noframes id='VI43E'>

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

      <tfoot id='VI43E'></tfoot>

    1. <legend id='VI43E'><style id='VI43E'><dir id='VI43E'><q id='VI43E'></q></dir></style></legend>
      1. 如何在选择时使 HTML 单选按钮变为粗体?

        时间:2023-10-20

          <legend id='2SJ7r'><style id='2SJ7r'><dir id='2SJ7r'><q id='2SJ7r'></q></dir></style></legend>

            <bdo id='2SJ7r'></bdo><ul id='2SJ7r'></ul>
                  <tbody id='2SJ7r'></tbody>

                <small id='2SJ7r'></small><noframes id='2SJ7r'>

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

                  本文介绍了如何在选择时使 HTML 单选按钮变为粗体?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  在 HTML 中,我有以下单选按钮选项

                  In HTML, I have the following radio button choices

                  o 选择 1
                  o 选择 2
                  o 选择 3

                  o Choice 1
                  o Choice 2
                  o Choice 3

                  我想要做的是,当有人从上方选择一个单选按钮时,与所选单选按钮对应的文本变为粗体.

                  What I would like to do is when someone SELECTs a radio button from above, that the text corresponding to that radio button selected becomes bold.

                  因此,例如 - 如果该人选择选择 2",则单选按钮选择现在看起来像:

                  So, for example - if the person selects "Choice 2", the radio button selection would now look like:

                  o 选择 1
                  o 选择 2
                  o 选择 3

                  o Choice 1
                  o Choice 2
                  o Choice 3

                  我该怎么做?我假设必须使用 JavaScript 或 CSS.

                  How do I do this? I assume either JavaScript or CSS has to be used.

                  提前致谢

                  更新:如果不使用 jQuery,你将如何实现nickf"解决方案?

                  推荐答案

                  你可以纯粹用 CSS 来做到这一点,但你需要将每个输入的文本包装在 span 或其他标签中:

                  You can do this purely with CSS, but you need to wrap the text of each input in a span or other tag:

                  <input type="radio" name="group1" value="Milk"><span>Milk</span><br>
                  

                  然后只使用兄弟选择器:

                  Then just use the sibling selector:

                  input[type="radio"]:checked+span { font-weight: bold; }
                  

                  这篇关于如何在选择时使 HTML 单选按钮变为粗体?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  上一篇:使用 Twitter Bootstrap 切换单选按钮,获取表单输入的简洁方式是什么? 下一篇:带有 javascript 的单选按钮样式

                  相关文章

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

                    <tfoot id='viwCE'></tfoot>
                  1. <small id='viwCE'></small><noframes id='viwCE'>