简体   繁体   中英

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?

<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.

HTML

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

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. http://twitter.github.com/bootstrap/

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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