2013-01-23 50 views
0

我有一個將用戶帶到另一個頁面的按鈕。我可以使用鏈接,但我希望它看起來像一個按鈕。它在IE7和IE8以外的任何地方都能正常工作,但我不知道爲什麼?用於鏈接的按鈕在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> 
+0

你忘了空格? '輸入類型=「按鈕」值=「打印報告」>' –

+0

斑點但沒有空間變化 – tatty27

+0

此外,這樣做是一個壞主意,您可以嘗試')」/>' –

回答

1

擺脫輸入並使用樣式<a>標籤。

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是Twitter的引導致意。 http://twitter.github.com/bootstrap/

+0

完美,謝謝! – tatty27

相關問題