代码之家  ›  专栏  ›  技术社区  ›  Jeff

Firefox未打开HTML链接、Chrome和Edge工作

  •  0
  • Jeff  · 技术社区  · 8 年前

    我的网站遇到了一个我以前从未见过的问题。我有一个“a”链接,可以链接到站点中的其他页面,它们在Edge、Chrome和Safari中运行得很好,但Firefox不会打开它们。我只是轻轻一点,什么也没发生。

    .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>
    
    1 回复  |  直到 8 年前
        1
  •  0
  •   angel9215    8 年前

    问题是HTML, a 不允许进入 button

    Link inside a button not working in firefox

    一种可能的解决方法是使用 click 要更改的按钮上的事件 window.location (使用javascript),但这不是真正的建议,再次检查我链接的问题,以了解有关变通方法和修复的更多详细信息。