Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/mislz28/public_html/wp-content/themes/css-faq-v2/timeweather/timeweather.php on line 19
  • Uncategorized
7 March 2008

Go Glossy!

I got this post from http://justtalkaboutweb.com/2008/02/04/css-web-20-glossy-text/ and I feel you may put this too to good news. I’ve tried it and it’s a sure winner.

How to create gradient text effect with a PNG image (pure CSS, no Javascript or Flash)?

Just put an empty <span> tag in the heading and apply the background image overlay using the CSS position:absolute property. This trick works on most browsers like Firefox, Safari, Opera and give some hacks to make it IE6-usable.

The Code

<h1><span></span>Just Talk About Web</h1>

Use the CSS to define styling of the H1.

h1 {/* optional styling, you can use whatever you wish */font: bold 300%/100% “Lucida Grande”;color: #000;

/* now, this is important */

position:relative;}

Now the gradient: we put a transparent PNG as a background image for the span element and set position property to absolute so it can go above the text.

h1 span, h2 span {background: url(gradient-glossy.png) repeat-x;position: absolute;display: block;

width: 100%;

height:27px;

}

Unfortunately, not all browsers support PNG transparency (IE6, for example). So for those browsers, please include this as well.


<!–[if lt IE 7]>
h1 span {
background: none;
filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src=’gradient-glossy.png’, sizingMethod=’scale’);
}<![endif]–>

Our finished product!

img

Tags:

Esta entrada fue publicada en7 March 2008a las13:12 y esta registrada en Uncategorized. Puedes seguir cualquier comentario a esta entrada a través delRSS 2.0feed. Puedes dejar un comentario, o rastrear desde tu sitio web

Dejar un comentario

Name (*)
Mail (will not be published) (*)
URI
Comentario