【发布时间】:2013-10-13 14:57:54
【问题描述】:
我在构建我的 wordpress 网站时遇到了一个奇怪的问题。引导按钮内的所有链接在 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;
}
【问题讨论】:
-
“不活跃”是什么意思?
-
@JoshC 我的意思是不工作,当你点击它时,它不会带你到页面
-
那时可能与CSS没有任何关系。它是 HTML 的结构。也许链接改变了,或者目录被移动了……只是一些建议。
-
在
<button>中包含<a>是无效的,spec here 表示按钮元素中不能有交互式内容后代 -
@JoshC 链接是动态创建的,这些链接和其他工作链接之间的唯一区别是这些链接位于带有上述 css 的
button标记内......并且仅在 firefox 中......奇怪
标签: css firefox twitter-bootstrap