如何实施<a> tag in bootstrap button</a>

时间:2014-11-20 08:50:04

标签: html css twitter-bootstrap button

Demo JS Fiddle

我无法在按钮中实现href

如果我这样说的话会有效:

<a href="/">
    <button type="button" class="btn btn-default btn-custom">
        <span class="glyphicon glyphicon-align-left" aria-hidden="true"></span>
        <br />
        <span class="btntext glyphicon-class">PP bậc thang</span>
    </button>
</a>

但这会导致这个混乱:

enter image description here

有什么简单的方法可以解决这个问题吗?非常感谢!

2 个答案:

答案 0 :(得分:9)

将btn类应用于a。

<a href="/" class="btn btn-default" ...

另请查看the docs

答案 1 :(得分:1)

我更新了你的小提琴,让按钮正常工作:http://jsfiddle.net/ettmujvg/9/

 <a href="#"  class="btn btn-default btn-custom">
      <span class="glyphicon glyphicon-align-left" aria-hidden="true"></span>
      <br />
      <span class="btntext glyphicon-class">PP bậc thang</span>
 </a> 
相关问题