Results 1 to 2 of 2

Thread: Linkbutton and forecolor with CSS?

  1. #1

    Thread Starter
    Frenzied Member
    Join Date
    Jan 2001
    Location
    Denmark
    Posts
    1,049

    Question Linkbutton and forecolor with CSS?

    Setting the color of a link button you use the forecolor attribute on
    Code:
    <asp:linkbutton id="btnLink7" text="test"  forecolor="white" runat="server"/>
    , but how do I set this if I wish to use a CSS?

  2. #2
    Hyperactive Member
    Join Date
    Aug 2002
    Location
    Fort Collins, CO
    Posts
    366
    Couple of different ways, use a css class or use the style attribute:
    Code:
    <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>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width