简体   繁体   English

链接按钮在ie7 / ie8中不起作用

[英]Button for link doesn't work in ie7/ie8

I have a button which takes the user to another page. 我有一个将用户带到另一个页面的按钮。 I could just use a link but I want it to look like a button. 我可以只使用链接,但我希望它看起来像一个按钮。 It works fine in everything except IE7 and IE8 but I have no idea why? 除了IE7和IE8以外,其他所有功能都可以正常工作,但我不知道为什么?

<div id="print_version">
          <a href="report_print.php?audit=<? echo $audit_id; ?>" target="_blank">
          <input type="button"value="Print Report"></a>
</div>

Get rid of the input and use a styled <a> tag. 摆脱输入并使用样式化的<a>标记。

HTML 的HTML

<div id="print_version">
     <a class="btn" href="report_print.php?audit=<?php echo $audit_id; ?>" target="_blank">Print Report</a>
</div>

CSS 的CSS

.btn {
    -moz-border-bottom-colors: none;
    -moz-border-left-colors: none;
    -moz-border-right-colors: none;
    -moz-border-top-colors: none;
    background-color: #F5F5F5;
    background-image: -moz-linear-gradient(center top , #FFFFFF, #E6E6E6);
    background-repeat: repeat-x;
    border-color: #E6E6E6 #E6E6E6 #A2A2A2;
    border-image: none;
    border-radius: 4px 4px 4px 4px;
    border-style: solid;
    border-width: 1px;
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.2) inset, 0 1px 2px rgba(0, 0, 0, 0.05);
    color: #333333;
    cursor: pointer;
    display: inline-block;
    font-size: 14px;
    line-height: 20px;
    margin-bottom: 0;
    padding: 4px 14px;
    text-align: center;
    text-decoration: none;
    text-shadow: 0 1px 1px rgba(255, 255, 255, 0.75);
    vertical-align: middle;
}

CSS is compliments of twitter bootstrap. CSS是twitter引导程序的补充。 http://twitter.github.com/bootstrap/ http://twitter.github.com/bootstrap/

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM