我在HTML表單中有四個按鈕。 下面是HTML:HTML/CSS按鈕不能在IE中正確顯示
<div class="fileinputs">
<input type="file" class="file" name="uploadedfile" />
<div class="fakefile">
<img src="../assets/images/uf_btt.png" />
</div>
</div>
<div class="fileinputs">
<input type="reset" class="file" />
<div class="fakefile">
<img src="../assets/images/reset_btt.png" />
</div>
</div>
<div class="fileinputs">
<input type="button" class="file" onclick="window.print()" />
<div class="fakefile">
<img src="../assets/images/print_btt.png" />
</div>
</div>
這裏是CSS:
input[type=submit]
{
width: 119px;
height: 47px;
}
input[type=button]
{
width: 119px;
height: 47px;
}
input[type=reset]
{
width: 119px;
height: 47px;
}
input[type=file]
{
width: 119px;
height: 47px;
}
div.fileinputs {
position: relative;
float: left;
}
div.fakefile {
position: absolute;
top: 0px;
left: 0px;
z-index: 1;
}
input.file {
position: relative;
text-align: right;
-moz-opacity:0 ;
filter:alpha(opacity: 0);
opacity: 0;
z-index: 2;
}
所有四個按鈕都顯示正常,除了IE,他們在那裏有點錯位所有的瀏覽器。在我看來,IE瀏覽器並不知道如何將圖片放在'文件'輸入類型之上,因此它的右邊有一個空格,它是透明的「瀏覽」按鈕。如果你在IE中打開頁面並嘗試使用這些按鈕,你會明白我的意思:eximi.dreamhosters.com/Hawaii/html/contact_email.php 有什麼想法嗎?
謝謝!
老實說,如果所有按鈕都是相同的,那麼選擇器無論如何都是多餘的。只需執行一個輸入{...}就足夠了,而且開銷少。 – bpeterson76 2010-07-23 14:29:42
親愛的本,非常感謝! 它的工作! 親愛的bpeterson,這正是我所做的(我猜) - 我對所有按鈕使用相同的一組類。 謝謝! – vlevsha 2010-07-23 15:17:58