I'd like to style the original Bootstrap's btn-group-justified with radio input fields (http://getbootstrap.com/javascript/#buttons-examples).

我想用无线电输入字段(http://getbootstrap.com/javascript/#buttons-examples)设置原始Bootstrap的btn-group-justified样式。

The original style looks like this:

原始样式如下所示:

but I'd like to make every button a square-shaped button and give them all some whitespace between each other. Something like this:

但是我想让每个按钮都成一个方形按钮,并在彼此之间给它们一些空白。像这样的东西:

I was trying with a bit modified html markup from Bootstrap examples

我尝试使用Bootstrap示例中的一些修改过的html标记

[data-toggle="buttons"] .btn>input[type="radio"] {
  display: none;
}

.category-select .btn-container {
  position: relative;
  width: 19%;
  padding-bottom: 19%;
  float: left;
  height: 0;
  margin: 1%;
  -moz-box-sizing: border-box;
  box-sizing: border-box;
}

.btn-container .btn,
.btn-container .btn input {
  max-width: 100%;
}
<div class="btn-group-justified category-select" data-toggle="buttons">
  <div class="btn-container">
    <label class="btn category category-one">
          <input type="radio" name="options" id="option1"> One
        </label>
  </div>
  <div class="btn-container">
    <label class="btn category category-two">
          <input type="radio" name="options" id="option2"> Two
        </label>
  </div>
  <div class="btn-container">
    <label class="btn category category-three">
          <input type="radio" name="options" id="option3"> Three
        </label>
  </div>
  <div class="btn-container">
    <label class="btn category category-four">
          <input type="radio" name="options" id="option4"> Four
        </label>
  </div>
  <div class="btn-container">
    <label class="btn category category-five">
          <input type="radio" name="options" id="option5"> Five
        </label>
  </div>
</div>

更多相关文章

  1. HTML的整个块未接收CSS类样式
  2. 1、html/css:基本样式总结
  3. TextView显示html样式的文字
  4. 样式通常以相同的组合出现:创建单个类还是组合元素?
  5. 如何让按钮点击之后才能点击注册,再次点击按钮可以使按钮变为未勾
  6. 单选按钮和多选按钮的样式设置
  7. 工作中遇到的几个CSS样式表的问题
  8. 在Chtmlview中,浏览多frame的框架的网页,有时点击按钮,这时只会触发
  9. 如何使用ajax向php发送与每个按钮相关的数据?

随机推荐

  1. Android layout布局属性、标签属性总结大
  2. Android(安卓)修改SeekBar样式,打造理想进
  3. [摘]android 入门xml布局文件
  4. ok6410 android driver(11)
  5. Android API中文文档GridView
  6. NestedScrollingParent, NestedScrolling
  7. 〖Android〗存在多个Android设备时,使用Sh
  8. Android Selector和Shape
  9. 关于android SDK安装Failed to fetch URL
  10. 【Android】如何调节屏幕亮度,关闭屏幕