【发布时间】:2015-01-14 02:01:01
【问题描述】:
我正在尝试在按下按钮时显示灯箱。问题是,当锚点在按钮周围时(如下面的代码),它会自动重定向到“mywebsite.com/myimage.jpg”。但是,当锚点在里面时,只有单击文本才会弹出灯箱。代码如下:
<a href="myimage.jpg" rel="lightbox" title="Title!" style="color:white" class="lightbox">
<div>
<button class="btn btn-lg btn-block" style="background:red">Button Text!</button>
</div>
</a>
【问题讨论】:
-
那么你想要发生什么?
-
我想要一个按钮来弹出灯箱
-
Problem is, when the href is around the button (like in the code below)...你能把这句话说完吗?有什么问题? -
<a>内的<button>无效。参见例如stackoverflow.com/a/6393863/2476884
标签: html twitter-bootstrap button anchor