【问题标题】:Firefox Not Opening HTML Links, Chrome & Edge WorkFirefox 无法打开 HTML 链接、Chrome 和 Edge 工作
【发布时间】:2018-03-09 17:05:36
【问题描述】:

我的网站遇到了以前从未见过的问题。我有 'a' 链接可以转到站点中的其他页面,它们在 Edge、Chrome 和 Safari 中完美运行,但 Firefox 无法打开它们。我只是轻按一下,没有任何反应。

我的导航 CSS 问题:

.navigation {
width: 75%;
position: relative;
left: 13em;
top: 3em;
display: -webkit-flex;
display: flex;
-webkit-justify-content: center;
justify-content: center;
}

.dropbtn {
background-color: transparent;
color: white;
font-size: 34px;
font-family: 'Anton', sans-serif;
border: none;
cursor: pointer;
}

.dropbtn:hover, .dropbtn:focus {
background-color: #680b1e;
}

#about {
position: relative;
display: inline-block;
float: left;
margin-left: 40px;
}

HTML

<div id="about">
<button class="dropbtn"> <a href="about.html"> Book </a> </button>    
</div>

【问题讨论】:

  • 不阅读html规则时会出现这种情况。

标签: html css google-chrome firefox mozilla


【解决方案1】:

问题在于 HTML,a 不允许在 button 内,更多详情请参阅此问题:

Link inside a button not working in firefox

一种可能的解决方法是使用按钮上的click 事件来更改window.location(使用javascript),但实际上并不推荐,再次查看我链接的问题以获取有关解决方法和修复的更多详细信息。

【讨论】:

猜你喜欢
  • 1970-01-01
  • 2021-09-11
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2017-06-12
  • 1970-01-01
  • 2022-08-05
  • 2021-09-14
相关资源
最近更新 更多