CSS Gradient Text Effect

Do you want to create fancy headings using pure CSS and no Photoshop? Then here is a cool method to create Gradient Headings.

Benefits

  • This is pure CSS trick, no Javascript or Flash. It works on most browsers including IE6 (PNG hack required).
  • It is perfect for designing headings. You don’t have to render each heading with Photoshop. This will save you time and bandwidth.
  • You can use on any web fonts and the font size remains scalable.

The HTML markups

{code type=css}


CSS Gradient Text

{/code}

The CSS

The key point here is:p {position: relative} and p span {position: absolute}

{code type=css}
p {
font: bold 330%/100% “Lucida Grande”;
position: relative;
color: #464646;
}
p span {
background: url(texteffect.png) repeat-x;
position: absolute;
display: block;
width: 100%;
height: 31px;
}

{/code}

To start with, Use text color in p tag. And then use the background effect in p span tag.When these two combine it gives the Gradient Text Effect.

LIMITATIONS

  • This trick is only suitable for solid background color elements. Your gradient color (PNG image) must be the same color as your background color.
  • IE PNG hack is required if you want it to work on IE 6.
  • If your gradient image is taller than the heading, the text will not be selectable.

TO WORK ON IE6

Since IE6 doesn’t render PNG-24 properly, the following hack is required in order to display the transparent PNG (add anywhere in between the <head> tag):

If It is IE7

{code type=css}

{/code}

Here are some examples for Gradient Text Effect.

GRADIENT SHINE

1

GRADIENT DARK SHINE

2

GRADIENT STRIPE

3

GRADIENT DARK STRIPE

4

For more information, you can refer:webdesignerwall.com

  • Share/Bookmark

This entry was posted on Tuesday, May 4th, 2010 at 12:36 am and is filed under CSS Tips. You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.

12 Responses to “CSS Gradient Text Effect”

  1. Gucci bags Says:

    Good web site, thank you a good deal for that amazing posts!…

  2. ugg boots Says:

    Thanks! it’s useful to me!…

  3. horsham photography Says:

    Great information! I found this inceedingly helpful and an interesting read. Photography, Graphics & Technology is in no way boring. :-)

  4. photography horsham Says:

    Superb words! I found this blog inceedingly helpful and an interesting read. Photography is in no way uninteresting. :]

  5. Bella Kuree Says:

    It was certainly interesting for me to read the article. Thank you for it. I like such themes and anything connected to them. I definitely want to read more soon.

  6. Anete Simpson Says:

    It is extremely interesting for me to read that article. Thanx for it. I like such themes and anything connected to this matter. I would like to read more soon.

  7. jack Says:

    Pretty nice post. I just stumbled upon your blog and wanted to say that I’ve truly enjoyed browsing your blog posts.,

  8. free wp theme Says:

    Well written

  9. Awesome CSS Gallery Says:

    Fantastic web site. A lot of useful information here. I am sending it to several pals ans additionally sharing in delicious. And obviously, thanks to your sweat!

  10. Sterilizer Says:

    I’ve learned a lot from your blog here,Keep on going,I will keep an eye on it

  11. ping site Says:

    ping site…

    [...]CSS Gradient Text Effect | Cogzidel Templates Blog[...]…

  12. Women in waders Calendar 2013 Says:

    Women in waders Calendar 2013…

    CSS Gradient Text Effect | Cogzidel Templates Blog…

Leave a Reply

« Back to text comment