2010-12-01 50 views
0

有人知道圖片點擊時可能會輕微移動/跳躍(只發生在IE中)嗎?這是我們的按鈕:點擊時按鈕圖像稍微向上移動(在Internet Explorer中)

<button class="join" name="register" value="" onClick="window.location = 'location'" tabindex="4"></button> 

這是類:

button.join { 
     background: url(../images/join.png); 
     border: 0; 
     height: 56px; 
     width: 178px; 
     cursor: pointer; 
     } 

回答

2

按鈕標籤始終得到正確的樣式跨瀏覽器的麻煩。只要你在onClick上使用JavaScript,沒有真正的理由使用按鈕標籤。嘗試使用錨標籤,定位所有狀態並設置圖像的位置。

<a class="join" href="#" id="register" onClick="window.location = 'location'" tabindex="4">Button</a> 

a.join:link, 
a.join:visited 
a.join:hover, 
a.join:active 
{ 
     background: url(../images/join.png) 0 0 no-repeat; 
     border: 0; 
     text-indent: -999em; /* Optional - To remove the HTML text from the button */ 
     height: 56px; 
     width: 178px; 
     cursor: pointer; 
} 
+0

謝謝,它的工作原理。 – catandmouse 2010-12-02 01:23:31