【问题标题】:Bootstrap radio buttons without plugins angular 2+没有插件的 Bootstrap 单选按钮 Angular 2+
【发布时间】:2018-02-09 04:39:37
【问题描述】:

是否可以隐藏圆形老式单选按钮,使其不会出现在 bootrap 单选按钮上?我只使用引导 css 没有 jquery 或其他插件。

目前的按钮是这样的

我希望它们看起来像这样

<div class="btn-group" data-toggle="buttons">
  <label class="btn btn-primary" [ngClass]="{'active': radioYes}">
    <input type="radio" name="options" id="option1" autocomplete="off" (click)="radioYes=true" > Yes
  </label>
  <label class="btn btn-primary" [ngClass]="{'active': !radioYes}">
    <input type="radio" name="options" id="option2" autocomplete="off"(click)="radioYes=false" > No
  </label>
</div>

使用 Bootstrap 4。没有额外的 css

【问题讨论】:

  • Bootstrap 默认隐藏圆圈。如果你有圆圈出现,那是因为另一种风格是冲突的。请更新您的问题以在minimal, complete, and verifiable example 中包含所有相关代码,包括您的 Bootstrap 版本。
  • 我使用的是 bootstrap 4,没有额外的 css 库。
  • Bootstrap 4 没有额外的 CSS 默认隐藏单选按钮:jsfiddle.net/rqh8p169
  • jsfiddle.net/mo8oxxq4 使用最新的引导程序
  • 只需要添加btn-group-toggle

标签: css angular twitter-bootstrap


【解决方案1】:

我发现了我的错误。

在最新版本的 Bootstrap (4.0.0) 中。包含按钮的 div 需要类 btn-group-toggle

相关讨论——https://github.com/twbs/bootstrap/issues/25281

【讨论】:

    猜你喜欢
    • 2017-04-29
    • 2016-09-29
    • 1970-01-01
    • 2015-07-14
    • 2019-08-18
    • 2018-04-11
    • 1970-01-01
    • 2019-07-14
    • 1970-01-01
    相关资源
    最近更新 更多