Twitter Bootstrap 3.0 how do I “badge badge-important” now

后端 未结 9 1762
执念已碎
执念已碎 2021-01-29 19:01

In version two I could use

badge badge-important

I see that the .badge element no longer has contextual (-success,-primary,etc..) c

9条回答
  •  借酒劲吻你
    2021-01-29 20:03

    Bootstrap 3 removed those color options for badges. However, we can add those styles manually. Here's my solution, and here is the JS Bin:

    .badge {
      padding: 1px 9px 2px;
      font-size: 12.025px;
      font-weight: bold;
      white-space: nowrap;
      color: #ffffff;
      background-color: #999999;
      -webkit-border-radius: 9px;
      -moz-border-radius: 9px;
      border-radius: 9px;
    }
    .badge:hover {
      color: #ffffff;
      text-decoration: none;
      cursor: pointer;
    }
    .badge-error {
      background-color: #b94a48;
    }
    .badge-error:hover {
      background-color: #953b39;
    }
    .badge-warning {
      background-color: #f89406;
    }
    .badge-warning:hover {
      background-color: #c67605;
    }
    .badge-success {
      background-color: #468847;
    }
    .badge-success:hover {
      background-color: #356635;
    }
    .badge-info {
      background-color: #3a87ad;
    }
    .badge-info:hover {
      background-color: #2d6987;
    }
    .badge-inverse {
      background-color: #333333;
    }
    .badge-inverse:hover {
      background-color: #1a1a1a;
    }
    

提交回复
热议问题