使用锚标记时的浏览器兼容性

时间:2014-07-11 04:49:06

标签: html

我正在使用anchor tag将我的欢迎页面链接到我的主页面。它正在处理chrome,但不在mozilla

代码:

 <div id="wel1"><h1>WELCOME TO ASSESMENT ENGINE</h1></div>
 <div id="wel2">
     <div id="wel3"><p id="wel4">Instruction:</p><br>
        <p id="lang">Total number of questions : 5.<br><br>
            Time alloted : 3 minutes.<br><br>
            Each question carry 10 mark, no negative marks.</p> 
     </div>
     <div id="wel5">
        <p id="wel4">
           Note:</p><br>
        <p >
          <ul>
            <li><p>Click the 'Submit Test' button given in the bottom of this page to Submit your answers.</p></li>
            <li><p>Test will be submitted automatically if the time expired.</p></li>
            <li><p>Don't refresh the page.</p></li>
          </ul>
        </p>
     </div>
     <a href="as.html"><button id="bu">START THE TEST</buttton></a>  
 </div>

在此图像中,START THE TEST按钮完美地处理镀铬,但不适用于Mozilla。

3 个答案:

答案 0 :(得分:2)

您的关闭代码无效</buttton> 尝试: -

<a href="as.html"><button id="bu">START THE TEST</button></a> 

Demo

答案 1 :(得分:1)

尽管如果更正了结束标记拼写错误,代码仍然有效,但在HTML5中嵌套交互元素是不合逻辑的:a element不能包含像button元素这样的交互式内容。单击这样的元素可以激活外部元素或内部元素,或两者。虽然在这种特殊情况下这可能无关紧要,但仍然不建议这样做。

相反,您可以使用按钮的图像并将其设为链接:

<a href="as.html"><img src="start.png" alt="START THE TEST" border="0"></a>

或使用最小形式(提交表单不同于链接,但差异通常无关紧要,或者可能是改进):

<form action="as.html"><button type="submit">START THE TEST</button></form>  

答案 2 :(得分:-1)

在结账按钮标记中拼写错误,使用</button>代替</buttton>