如何将引导类按钮链接到外部站点

时间:2017-07-03 19:08:50

标签: twitter-bootstrap button hyperlink external

我遇到了我创建的按钮并尝试链接到外部网站的问题。我的代码是

<div id="home-btn" class="animated zoomIn">
   <a class="btn btn-lg btn-general btn-white smooth-scroll"  
   href="http://www.yumpu.com/fr/embed/view/OPR2Gbw5Ml83hkp4" target="_blank" 
   role="button"  title="Magazine Carrefour Floride en ligne">Clicquez ici pour 
   lire le Magazine en Ligne</a>
   </div>

我试图将href放在哪里但是同样的东西不起作用。 谢谢!

3 个答案:

答案 0 :(得分:0)

你的html代码似乎很好,为我做了一点测试,也许你的问题是样式,检查你是否意外地禁用了其中一个css类中的链接功能:class =“animated zoomIn”or class = “btn btn-lg btn-general btn-white smooth-scroll”,希望这可以帮到你

答案 1 :(得分:0)

向链接添加按钮角色是阻止默认行为的原因。要么删除role属性,要么修改代码以使其看起来很清楚;

<div id="home-btn" class="animated zoomIn">
    <a href="http://www.yumpu.com/fr/embed/view/OPR2Gbw5Ml83hkp4" target="_blank">
        <button class="btn btn-lg btn-general btn-white smooth-scroll"  type="button" title="Magazine Carrefour Floride en ligne">Clicquez ici pour lire le Magazine en Ligne.   <button> 
    </a>

答案 2 :(得分:0)

我清理了代码,并添加了btn-default。 如果您想改变颜色,请从以下选项中选择:

.btn
.btn-default
.btn-primary
.btn-success
.btn-info
.btn-warning
.btn-danger
.btn-link

你编码:

<div id="home-btn" class="animated zoomIn">
  <a class="btn  btn-default btn-lg btn-general btn-white smooth-scroll" 
    href="http://www.yumpu.com/fr/embed/view/OPR2Gbw5Ml83hkp4" target="_blank"> 
    Clicquez ici pour ire le Magazine en Ligne
  </a>
</div>