twitter-bootstrap Bootstrap 单选按钮:单选圆移除

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/18714735/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-10-21 18:19:36  来源:igfitidea点击:

Bootstrap Radio button : radio circle removal

htmltwitter-bootstrap

提问by Shari

I am trying to use Bootstrap for my website. I have radio buttons and I am trying to use "Buttons" from bootstrap for the same.

我正在尝试为我的网站使用 Bootstrap。我有单选按钮,我正在尝试使用 bootstrap 中的“按钮”。

<td style="margin-bottom:0px; padding-bottom: 0px;font-size=12px;vertical-align:bottom;">
    <div class="btn-group" data-toggle="buttons" id="topButtonDiv" >
        <button type="button" class="btn btn-primary">Home
        <input type="radio" id="radio1" ></button>
        <button type="button" class="btn btn-primary">Home1
        <input type="radio" id="radio2" > </button>
        <button type="button" class="btn btn-primary">Home2
        <input  type="radio" id="radio7"> </button>                
     </div>
</td>

The problem I am facing is that I still see the circles in the Radio button present, where as in the Bootstrap example, I see no such circles present.

我面临的问题是我仍然看到单选按钮中的圆圈存在,而在 Bootstrap 示例中,我看不到这样的圆圈。

http://getbootstrap.com/javascript/#buttons-usage

http://getbootstrap.com/javascript/#buttons-usage

Can you let me know what I am missing here?

你能告诉我我在这里缺少什么吗?

采纳答案by scarecrow

Check for the version of css you've added. The same btn-groupclass works fine here

检查您添加的 css 版本。同一个btn-group在这里工作正常

回答by PHIN

Another alternative if the css version update is not working is to manually hide the radio button using css

如果 css 版本更新不起作用,另一种选择是使用 css 手动隐藏单选按钮

[type='radio'] {
display: none; 
}

回答by Sebsemillia

Your markup for bootstrap radio buttons is wrong, you make it like this:

您对引导单选按钮的标记是错误的,您将其设置为:

<div class="radio">
<label>
<input type="radio" name="optionsRadios" id="optionsRadios1" value="option1" checked>
Option one is this and that&mdash;be sure to include why it's great
</label>
</div>

Furthermore you can't put a input element within a button element. That's invalid html.

此外,您不能将输入元素放在按钮元素中。那是无效的html。