9. August 2008 01:28 by Janko in Tutorials | tags:

When I first saw CSS text gradient effect I asked myself how this trick can be used to create some more effects. Actually, there are an infinite number of effects you can create - the limit is your imagination. In this short tutorial you will see how to add grunge effect to your text using just CSS and one image.

Step 1: Create a transparent PNG image

You can use Gimp or Photoshop and some of the free brushes:

Experiment with the brushes and color, but keep in mind that the color you use must match the color of your background. The image we are going to use in this example looks like this:

grunge2

So, we are going to make a grunge effect on a black background.

Step 2: Create simple CSS

Now we are going to add grunge effect on H1 element. In order to make this work we need a little trick: place an empty span tag inside each H1 element. Be sure to add it after the text like in the example below.

<h1>This is one very long title with grunge effect<span></span></h1>

Now the CSS magic. We are going to use absolute positioning inside relative positioning (I mentioned this in my article How to create web application user interface that looks like Outlook several weeks ago). So, we are going to place absolutely positioned span element inside the relatively positioned H1 element. That way a grunge image that is actually a background image of span element will make an overlay on H1 element.

h1 {
    position:relative;
    color:#aeef33;
    font-family: Georgia;
}

h1 span{
    position:absolute;
    display:block;
    top:0;
    left:0;
    height:100%;
    width:100%;
    background:url('grunge.png');
}

And viola! This is the result:

grunge effect

Download the example See it live

Step 3: Experiment

Try to find some interesting brushes or patterns which you can use to create a different effects. For more information about CSS text effects, read the following articles:

If you liked this article why don't you share it:

Stumble it delicious Digg it Float it DZone it Kick it Bump it E-mail

Comments

Pingbacks and trackbacks

  1. Trackback from DotNetKicks.com Add grunge effect to text using simple CSS
  2. Pingback from designm.ag Add Grunge Effect to Text Using Simple CSS | DesignM.ag
  3. Pingback from colordeu.es Fondo Grunge en texto con CSS - colorate
  4. Pingback from nsdhami.wordpress.com 25 Awesome tutorials for web designers « Narendra Dhami
  5. Pingback from guiwells.wordpress.com 25 Awesome tutorials for web designers « Guiwells’s Blog
  6. Pingback from soft-911.net From free for free » Blog Archive » 25 Awesome tutorials for web designers
  7. Pingback from alexilin.ru Как сделать текст в стиле грандж используя немного CSS | HTML и CSS, доступность и юзабилити — Life Style
  8. Pingback from boxedcss.com 25 Awesome tutorials for web designers | Boxed CSS
  9. Pingback from cnet.ro Janko ÅŸi aspectul formularelor web | CNET.ro
  10. Pingback from missakins.com m i s s a k i n s » Blog Archive » links for 2008-08-24
  11. Pingback from yogodoshi.com Tutorial: Como colocar um efeito grunge em um texto apenas com CSS - Blog do yogodoshi - Tecnologia, Blogosfera, web 2.0 e Humor é claro!
  12. Pingback from pejag.cn 25 Awesome tutorials for web designers | 打篮球的手
  13. Pingback from rssa.org.cn RSSA聚合 » 25 Awesome tutorials for web designers
  14. Pingback from alexawesome.com alexawesome.com » Blog Archive » Geek Week - Cool Stuff for the week of 09/08/08

Add comment

   
        Country flag
biuquote
Loading