一个href标签在Internet Explorer中不起作用

时间:2015-05-13 12:00:47

标签: html css cross-browser href internet-explorer-11

我正在我的页面中使用href标签创建一个按钮,它在chrome中运行良好。但它根本没有在Internet Explorer中工作,按钮的代码是

 <td class='swMntTopMenu' style="text-align:right">
  <button style="background-color:rgb(255,213,32)">
     <a href ='list.php' style="text-decoration:none !important;">
       <div class="link"> Back  </div> 
     </a>
 </td>

并且使用的样式代码是

.swMntTopMenu
            {
                background-color: #E2E4E5;
                /* float: center;*/
                width: 5%;
                margin-top: 2px;
                padding-bottom: 6px;
                border-bottom: solid 1px #d0ccc9;
            }

.link
            {
                color: #0E0202;
                text-decoration: none;
                background-color: none;
            }

任何人都可以帮我这个吗?

4 个答案:

答案 0 :(得分:3)

希望这会有所帮助

<a href ='list.php' style="text-decoration:none !important;"><button style="background-color:rgb(255,213,32)">  <div class="link"> Back </div> </button></a>

答案 1 :(得分:1)

正如我在评论中所说,您没有关闭button元素。另外,您不能在a元素中使用button

a的样式设置为按钮 - 这是一个不错的CSS button generator

或者将button放在表单中 - How to create an HTML button that acts like a link?

答案 2 :(得分:0)

在较旧的IE中,当您将A放入其中时,应该有助于将div声明为阻止。

a {display: block}

答案 3 :(得分:0)

请尝试使用这种方式

<form action="list.php">
    <input type="submit" value="Back">
</form>
相关问题