PDA

Click to See Complete Forum and Search --> : Linkbutton and forecolor with CSS?


hpl
Feb 11th, 2003, 06:25 AM
Setting the color of a link button you use the forecolor attribute on

<asp:linkbutton id="btnLink7" text="test" forecolor="white" runat="server"/>

, but how do I set this if I wish to use a CSS?

pvb
Feb 13th, 2003, 06:14 AM
Couple of different ways, use a css class or use the style attribute:

<html>
<head>
<style type="text/css">
a.MyLinkButton
{
color:#000088;
text-decoration:none;
}
a.MyLinkButton:hover
{
color:#00aacc;
text-decoration:underline;
}
</style>
</head>
<body>
<form runat="server">
<asp:LinkButton
id="MyLinkButton"
runat="server"
text="My Link Button"
CssClass="MyLinkButton"/><br />
<asp:LinkButton
id="MyLinkButton2"
runat="server"
text="My Other Link Button"
style="color:#000088;font-weight:bold;text-decoration:none;"/>
</form>
</body>
</html>