473,414 Members | 1,688 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,414 software developers and data experts.

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
Mar 27 '09 #1
6 3094
Frinavale
9,735 Expert Mod 8TB
Have you considered creating a CSS style for the button and setting the Button's CssClass property to this style?

For example:
Expand|Select|Wrap|Line Numbers
  1. <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

Expand|Select|Wrap|Line Numbers
  1. <asp:Button ID="myButton" runat="server" style="background-color:navy; color:white;" />
Have you considered using an ImageButton?
Mar 27 '09 #2
what i've done is.. i used lable and put it in an ordered list and then use css to "decorate" it

the asp:
Expand|Select|Wrap|Line Numbers
  1. <li><asp:HyperLink ID="hyperlink1" CssClass="button" runat="server">
  2. <asp:Label ID="lable1" runat="server" text="click"> </asp:Label></asp:HyperLink></li>
  3.  
th css
Expand|Select|Wrap|Line Numbers
  1. .button
  2. {
  3. float:            left;
  4. width:            6em;
  5. text-decoration:    none;
  6. color:            #808080;
  7. background-color:    #add8e6;
  8. padding:        0.2em 1.0em;
  9. border-right:        1px solid #add8e6;
Mar 27 '09 #3
Frinavale
9,735 Expert Mod 8TB
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:

Expand|Select|Wrap|Line Numbers
  1. <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
Mar 27 '09 #4
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..
Mar 27 '09 #5
Frinavale
9,735 Expert Mod 8TB
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
Mar 27 '09 #6
thanks for your help mate
Mar 27 '09 #7

Sign in to post your reply or Sign up for a free account.

Similar topics

5
by: Woody Splawn | last post by:
I have a webform where I would like to have the background color for the webform be a gradient in blue. How do I do this? What is the easiest way? What is the way most used by other developers? ...
3
by: Maziar Aflatoun | last post by:
Hi everyone, Does anyone know how I can apply the css 'linksmall' to my hyperlink in my datagrid? I have the following and it doesn't work <asp:HyperLinkColumn Text="Edit"...
13
by: Crirus | last post by:
The main ideea: I havea 513x513 array of values....I draw a sort of map using that values for colors... so I have a realistic lanscape (map). I want to zoom about 60 times that map...and the...
0
by: Don | last post by:
I'm making a custom control that has a multiline textbox on it. I want to make the textbox have a gradient background. On my custom control's Paint event I call a routine that draws a gradient on...
2
by: Dean Slindee | last post by:
It appears that I have two routines that don't play well together! First routine: a form's background is shaded with a gradient color. Second routine: then, the background of all labels on the...
4
by: Jon Slaughter | last post by:
I'm drawing a linear gradient and its very "banded". The colors are far enough part that it should be plenty smooth enough but I always get the same number of bands regardless. I've tried to set...
1
by: madladuk | last post by:
Hi all. Does anyone have any example of how to do a gradient background whilst moving over graphics and text like the Microsoft web site. On the MS site when you select an area a window popup...
6
by: moondaddy | last post by:
I want to fill the entire background of a page with a gradient. As a test, I first filled with a solid color like this: <body style="background-color: #ccffff;" > and the entire page was this...
2
by: Mirco Attocchi | last post by:
Hi all, someone know how to fill with gradient a box or a field or entire column in detail section? Thanks Mirco Attocchi
9
by: Eric Lindsay | last post by:
How do you provide a consistent gradient fill as a background in a liquid layout? If I make a gradient fill image say 1000 pixels wide (and repeat it down the page) to suit a typical computer...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.