不可点击的对象,看起来像Bootstrap 3中的按钮

时间:2015-10-23 18:33:42

标签: twitter-bootstrap-3

是否有一种简单的(非hackish?)方式使Bootstrap按钮看起来不可点击(我不是指一个禁用的按钮)。基本上<div class="btn btn-default">Something</div>并不像链接那样。

提前致谢

3 个答案:

答案 0 :(得分:12)

我在使用新课程btn-static之前完成了这项工作:

.btn-static {
  background-color: white;
  border: 1px solid lightgrey;
  cursor: default;
}
.btn-static:active {
  -moz-box-shadow:    inset 0 0 0px white;
  -webkit-box-shadow: inset 0 0 0px white;
  box-shadow:         inset 0 0 0px white;
}

使用它如下:

<div class="btn btn-static">Static</div>
<!-- btn-default for comparison -->
<button type="button" class="btn btn-default">Default</button>

所以现在它看起来像一个按钮,但是当你点击它时它不像一个按钮。

Bootply Link for Example

答案 1 :(得分:2)

这似乎也有效:

<div class="btn btn-default disabled" style="cursor:default;">Something</div>

答案 2 :(得分:0)

.btn-block+.btn-block{margin-left:0}