问题描述
我想为网页使用链接按钮,但是它没有mouseover和mouseout事件.我想用那些改变链接按钮的样式.我怎样才能做到这一点?请举个例子!
谢谢!
-------------------------------------------------- --------------------
如何在发生鼠标事件时更改其背景图像.
I want to use a linkbutton for a webpage, but it doesn''t have a mouseover and mouseout event. I want to use those to change the style of the linkbutton. How can i do this? Please give me an example!
Thanks!
----------------------------------------------------------------------
how to change its backgroundimage when occur a mouse event.
推荐答案
a.SelectedItem:link,
a.SelectedItem:visited {
color:#ffffff;
}
a.SelectedItem:hover {
color:#999999;
}
a.SelectedItem:active {
color:#ffffff;
}
在您的ASPX中,链接按钮应如下所示:
And in your ASPX your link button should be like this:
<asp:LinkButton CssClass ="SelectedItem" .... runat="server">Click Me!</LinkButton>
请注意,如果仅使用a:link, a:visited, a:hover, a:active
,则样式将自动应用于页面中的所有链接.
Please note if you just use a:link, a:visited, a:hover, a:active
, the styles will be applied to all links in the page automatically.
这篇关于如何为linkbutton添加鼠标悬停事件. (asp.net)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!