我在构建我的 wordpress 网站时遇到了一个奇怪的问题。 Bootstrap 按钮内的所有链接在 Firefox 中均未激活。
什么会导致这种情况?
这是 html 输出:
<button class="btn pull-right" role="button">
<a href="http://domain.dev/?cat=4" name="View all News">
All News
</a>
</button>
这是CSS:
.home #primary #home-more .btn {
background-image: url("../img/home-button-sprite-more.png");
background-repeat: no-repeat;
margin-right: 0px;
background-color: transparent;
padding: 13px 40px;
background-position: 20px 0px;
}
button.btn {
display: inline-block;
padding: 13px 24px;
margin-bottom: 0px;
margin-right: 10px;
font-size: 10px;
text-transform: uppercase;
font-weight: bold;
line-height: 1;
text-align: center;
vertical-align: middle;
cursor: pointer;
border: medium none;
border-radius: 0px 0px 0px 0px;
white-space: nowrap;
-moz-user-select: none;
}
最佳答案
代替,
<button class="btn pull-right" role="button">
<a href="http://domain.dev/?cat=4" name="View all News">
All News
</a>
</button>
你必须使用,
<a href="http://domain.dev/?cat=4" name="View all News">
<button class="btn pull-right" role="button">
All News
</button>
</a>
或者,
<a href="http://domain.dev/?cat=4" title="View all News" class="btn pull-right">
All News
</a>
关于css - 带有 Bootstrap 按钮的 Firefox 中的链接不活动,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19218013/