我們在使用button做按鈕時常常會碰到如果在button中使用img做按鈕圖片時在IE中顯示正常,而在FF中左邊和上邊會出現灰邊,以下是解決方案。
<style type="text/css">
button {
width:100px;
height:30px;
border:0;
}
button img {
margin:-2px 0 0 -3px !important; //在FF中需調整邊界
margin:0; //在IE中不顯示邊界
}
</style>
<button type="submit"><img src="按鈕圖片" width="100" height="30" border="0" /></button>
button {
width:100px;
height:30px;
border:0;
}
button img {
margin:-2px 0 0 -3px !important; //在FF中需調整邊界
margin:0; //在IE中不顯示邊界
}
</style>
<button type="submit"><img src="按鈕圖片" width="100" height="30" border="0" /></button>