Apply a gradient to hyperlink text

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • wassssup
    New Member
    • Oct 2007
    • 47

    Apply a gradient to hyperlink text

    hi,
    i was wondering how do i put color that will look like from darker color to lighter color in a button.
    for example: in a button, instead of having only 1 shade or 1 tone, i would like it to be lets say from dark blue to light blue..

    your help is much appriciated
  • Frinavale
    Recognized Expert Expert
    • Oct 2006
    • 9749

    #2
    Have you considered creating a CSS style for the button and setting the Button's CssClass property to this style?

    For example:
    Code:
    <asp:Button ID="myButton" runat="server" CssClass="theStyleClassForTheButton" />
    Have you considered using the Button's style property to set the style of the button?

    For example

    Code:
    <asp:Button ID="myButton" runat="server" style="background-color:navy; color:white;" />
    Have you considered using an ImageButton?

    Comment

    • wassssup
      New Member
      • Oct 2007
      • 47

      #3
      what i've done is.. i used lable and put it in an ordered list and then use css to "decorate" it

      the asp:
      Code:
      <li><asp:HyperLink ID="hyperlink1" CssClass="button" runat="server">
      <asp:Label ID="lable1" runat="server" text="click"> </asp:Label></asp:HyperLink></li>
      th css
      Code:
      .button
      {
      float:			left;
      width:			6em;
      text-decoration:	none;
      color:			#808080;
      background-color:	#add8e6;
      padding:		0.2em 1.0em;
      border-right:		1px solid #add8e6;
      Last edited by Frinavale; Mar 27 '09, 02:04 PM. Reason: Added [code] tags. Please post code in [code] [/code] tags.

      Comment

      • Frinavale
        Recognized Expert Expert
        • Oct 2006
        • 9749

        #4
        You didn't mention it was a LinkButton.

        This is not a good solution.
        There's a better way to do this.

        The reason it's not a good solution is because when the HTML is generated it will look like this:

        Code:
        <a href="someUrl" ><span class="button"> text for the link button </span></a>
        This is not valid HTML. You cannot have a <span> within an <a>.
        Therefore, I recommend you remove the Label from within your LinkButton to avoid problems in browsers. Set the style for the LinkButton instead.

        Are you attempting to make a "gradient" on the link button?


        -Frinny

        Comment

        • wassssup
          New Member
          • Oct 2007
          • 47

          #5
          ah yes gradient is the word..i kinda forgot what is it called..u have any tips on that?
          thanks for the advise!! i dint know that it was a bad design...vs 2005 din give me ay problems..so i thought it was alright..

          Comment

          • Frinavale
            Recognized Expert Expert
            • Oct 2006
            • 9749

            #6
            I have no idea how to create a gradient using CSS...
            I think this question's better asked in the CSS forum.
            I'll move it there for you.

            Just remember that your LinkButton is rendered as a hyperlink, so what you're actually looking for is how to apply a gradient to hyperlink text.

            -Frinny

            Comment

            • wassssup
              New Member
              • Oct 2007
              • 47

              #7
              thanks for your help mate

              Comment

              Working...