Wednesday, December 29, 2010

How change ASP linkbutton control color at client side on Mouse over

Use <div> to with linkbutton to change color. it will not
work if you do not use div or another container control.
use cssclass property except the id of the controls.
 
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<style type="text/css" rel="stylesheet">
.customhover a
{
background-color: Purple;
}
.customhover a:hover
{
background-color: Yellow;
}
</style>
</head>
<body>
<form id="Form1" runat="server">
<div>
<div class="customhover">
<asp:LinkButton ID="LinkButton1" runat="server"
CssClass="customhover">Click Here</asp:LinkButton>
</div>
</div>
</form>
</body>
</html>

No comments :

Post a Comment