Just Talk About Web

Techniques Behind Modern Web

CSS Web 2.0 Glossy Text


Well, you don’t need to be a Photoshop pro to create glossy text that seems very trendy today (Web 2.0 styles? hmm).

css gradient effect

Here is a simple CSS trick to show you 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: Firefox, Safari, Opera, and even Internet Explorer 6 (with a small CSS hack).

The code looks like this:

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

Use the CSS to define styling of the H1. Make sure that you set position property to relative;.

1
2
3
4
5
6
7
8
 
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.

1
2
3
4
5
6
7
8
 
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.

1
2
3
4
5
6
7
<!--[if lt IE 7]>
	h1 span {
	  background: none;
	  filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='gradient-glossy.png', sizingMethod='scale');
	}
 
<![endif]-->

Now, see what we have:

CSS Glossy Text

Look cool? Please note that you can use any text color you want and you can vary gradient effect as long your gradient color is the same as your background color.

View demo here and download demo files here.


Free Website Magazine: Know more than your competitors with Website Magazine

Don't forget to subscribe so you don't miss out on future posts!

  • 20 Comments
  • Filed under: CSS, Tutorials, Web 2.0
  • Everyone talks about Microsoft’s $45 billion offer for Yahoo these days and, on the other hand, it is seen by many here as just what is needed to repel another monopolist in the making: Google.

    MicroHoo!

    “We would prefer to see a healthy Microsoft and Yahoo,” says Geoff Yang, a venture capitalist with Redpoint Ventures and an early investor in Internet-based companies. “But I am starting to get worried about Google’s dominance, and in the absence of…




  • 0 Comments
  • Filed under: Yahoo
  • Javascript Progress Bar

    Bramus introduces a new version of jsProgressBarHandler with bugfix to making multiple barImages properly work with Safari and addition of an internal queue.

    Javascript progress bar demo

    jsProgressBarHandler is a Javascript based Percentage Bar / Progress Bar, inspired upon JS-code by WebAppers and CSS-code by Bare Naked App. Next to a structural rewrite of the WebAppers code, this javascript progress bar can easily be extended and tweaked just by setting a few parameters.

    jsProgressBarHandler has been tested…




    Top SEO Tips for WordPress Blog

    I just want to share the best SEO tips (among a lot of other recommended tips) that work very well for my WordPress blog.

    1. Permalinks

    Change your WordPress permalinks to be search-engine friendly. To change the default link type, go to Options -> Permalinks.

    Wordpress permalinks

    Select the more search-engine-friendly option:

    SEO permalink option for WordPress

    Please read a very comprehensive article about WordPress permalinks from Web Tool Collections.

    2. Create a Sitemap

    A sitemap is…




  • 34 Comments
  • Filed under: Tutorials, Web 2.0
  • JavaScript Date Functions

    Matt Snider reveals another useful set of JavaScript functions targeting Date manipulation. He follows the same approach to extend String functions.

    First, he adds additional functionality to JS native Date object (constants and static methods)




    Google Docs Offline in Test

    Offline access to Google Docs is being tested as this screenshot shown:

    google-docs-offline-access.png

    For sure, you’ll need Google Gears — a browser extension for Firefox 1.5+ and Internet Explorer 6.0+ to facilitate offline functionality in web applications through JavaScript APIs — installed.

    Enabling offline access and confirming the security warning for Google Gears, your documents will start to synchronize — process looks the same as feed items synchronize in Google Reader.

    At…




  • 1 Comment
  • Filed under: Google
  • You will not see “Hello World” example in David Geary’s book, Google Web Toolkit Solutions: More Cool & Useful Stuff, because it’s not a book for newbies. Instead, the authors tell very clearly in the opening of the book that their target is to put GWT developers into the fast lane with practical, non-contrived solutions — not to help people brand new to GWT get started.

    Experienced programmer (not necessary being experienced in AJAX programming), who want…




  • 0 Comments
  • Filed under: Book Reviews, GWT
  • David Sarno of The Los Angeles Times tells an embarrassing experience when he sent an image of two half-dressed women kissing while perched atop a pair of beer kegs — to seventy-six of his friends with caption read: “COLLEGE: The only place where . . . like this happens!” via one of most popular Facebook apps, Super Wall.

    On the other hand, The New York Times has a funny article on the…




  • 1 Comment
  • Filed under: Facebook
  • Rails 2.0 reveals many changes and improvements, but the biggest change involves getting closer to the full web-orientation of REST and HTTP. With a few lines of codes now you can easily create open web applications based on modern web service.

    Creating Rails application

    This example is a deadly-simple bookstore CMS. All you can do are to get book list, add or delete books. Not much? Yes, but big news is you can do that from anywhere…




    Ext 2.0.1 Released

    The Ext team has to announced the release of version 2.0.1 of Ext JS. This is a maintenance release that fixes several issues with the 2.0 release.

    Here are some notable issues that have been addressed:

    • Fixed various overflow/scroll issues related to form fields and grid
    • Workaround included for the Firefox 2.0/Mac overflow:auto invisible scrollbar bug
    • Fixed several issues related to destroying form elements
    • Multiple GridView and GroupingView fixes




    Premium Sponsors

    Website Magazine

    Career Opportunities

    Advertisements