<legend id='nd416'><style id='nd416'><dir id='nd416'><q id='nd416'></q></dir></style></legend>

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

      1. <tfoot id='nd416'></tfoot>

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

        样式单选按钮 - 在 IE 和 Firefox 中不起作用

        Styling radio button - not work in IE and Firefox(样式单选按钮 - 在 IE 和 Firefox 中不起作用)

            <legend id='kiYn8'><style id='kiYn8'><dir id='kiYn8'><q id='kiYn8'></q></dir></style></legend>
                <tbody id='kiYn8'></tbody>
            • <small id='kiYn8'></small><noframes id='kiYn8'>

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

                • <tfoot id='kiYn8'></tfoot>
                  本文介绍了样式单选按钮 - 在 IE 和 Firefox 中不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我尝试制作自己风格的单选按钮.在 Chrome 中一切正常,但在 IE 和 Firefox 中仍然存在一些显示错误.

                  I have tried to make own style of radio button. Everything works well in Chrome, but in IE and Firefox there are still some display errors.

                  代码如下:

                  HTML

                  <input type="radio" id ="light" name="choice" value="none""><label for="light">Light me</label>
                  

                  CSS

                  input[type="radio"] {
                  appearance: none;
                  -webkit-appearance: none;
                  -moz-appearance: none;
                  background:url('http://refundfx.com.au/uploads/image/checkbox_empty.png') center center no-repeat;
                  background-size: 2em;
                  width: 2em;
                  height: 2em;
                  cursor: pointer;
                  vertical-align: middle;
                  }
                  

                  怎么了?

                  非常感谢您的回答.

                  推荐答案

                  试试这个:jsfiddle

                  您需要做的是隐藏单选按钮并仅使用标签来切换它.所以,我将 input[type="radio"] 设置为 display:none,并将一些 CSS 移动到 label 选择器或按钮的新选择器,我给了类按钮":

                  What you need to do is hide the radio button and only use the label for toggling it. So, I set input[type="radio"] to display:none, and moved some of the CSS to the label selector or a new selector for the button, to which I gave the class 'button':

                  HTML:

                  <input type="radio" id ="light" name="choice" value="none"">
                  <label for="light">
                  <span class="button"></span>
                  Light me
                  </label>
                  

                  CSS:

                  input[type="radio"] {
                      display:none;
                  }
                  .button {   background:url('http://refundfx.com.au/uploads/image/checkbox_empty.png') center center no-repeat;
                      background-size: 2em;
                      width: 2em;
                      height: 2em;
                      float:left;
                  }
                  label { 
                      cursor: pointer;
                      line-height:32px;
                  }
                  
                  

                  以下是使用 CSS 对输入进行样式化的一个很好的演练:http://www.wufoo.com/2011/06/13/custom-radio-buttons-and-checkboxes/

                  Here's a good walk through of stylizing inputs with CSS: http://www.wufoo.com/2011/06/13/custom-radio-buttons-and-checkboxes/

                  这篇关于样式单选按钮 - 在 IE 和 Firefox 中不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  keeping radio buttons checked after form submit(表单提交后保持选中单选按钮)
                  Toggle HTML radio button by clicking its label(通过单击标签来切换 HTML 单选按钮)
                  Javascript how to change radio button label text?(Javascript如何更改单选按钮标签文本?)
                  How can I automatically select specific radio buttons with Greasemonkey?(如何使用 Greasemonkey 自动选择特定的单选按钮?)
                  How to customize radio button in html(如何在html中自定义单选按钮)
                  getting selected value of radio button in case of action(在采取行动的情况下获取单选按钮的选定值)
                      <tbody id='KgrqM'></tbody>
                    1. <small id='KgrqM'></small><noframes id='KgrqM'>

                    2. <tfoot id='KgrqM'></tfoot>

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

                            <bdo id='KgrqM'></bdo><ul id='KgrqM'></ul>
                            <legend id='KgrqM'><style id='KgrqM'><dir id='KgrqM'><q id='KgrqM'></q></dir></style></legend>