如何为linkbutton添加鼠标悬停事件. (asp.net) [英] How to add a mouseover event for linkbutton. (asp.net)

查看:75
本文介绍了如何为linkbutton添加鼠标悬停事件. (asp.net)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想为网页使用链接按钮,但是它没有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.

推荐答案

我在论坛中找到了它.希望这会有所帮助
CSS应该是这样的:
I found this in a forum. Hope this will help
Css should be like this:
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)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆