方法一:用
onmouseover和
onmouseout 實現
<asp:Imgbutton runat="server" src="drop.gif" onmouseover="this.src='drop.gif'" onmouseout="this.src='tabs2_2.gif'" />
方法二:用 css 自帶的樣式去實現。
CSS樣式
/*大按鈕*/ .btn_big { border-style: none; border-color: inherit; border-width: medium; background-image: url('bt.jpg'); width: 60px; height: 20px; color:#113E75; } /*大按鈕滑動后改變樣式*/ .btn_big:hover { background-image: url('bt_B.jpg'); color:White; }
按鈕引用
<asp:Button ID="btcx" runat="server" Text="查詢" CssClass="btn_big" OnClick="btcx_Click" />
原圖: 效果圖:


