W3C.US

  • Increase font size
  • Default font size
  • Decrease font size
Home Tutorial HTML5 Text with shadow in CSS3

Text with shadow in CSS3

E-mail Print PDF

As it is too simple, i do not want to tell you how to make text with shadow in CSS3.

The CSS code:

.text-with-shadow {
    text-shadow: 3px 5px 10px #000;
}

The 4 values stand for: the offset on x(3px), the offset on y(5px), the radius of blur(10px), the color value(#000 black).

The HTML code:

<p class="text-with-shadow">Hello world</p>

To see the demo.

Though the text shadow is so easy, we can use it to make wonderful effects:

 

.flaming {
    text-shadow: 0 0 4px white, 0 -5px 4px #FFFF33, 2px -10px 6px #FFDD33, -2px -15px 11px #FF8800, 2px -25px 18px #FF2200
}

 

You can add several shadow values together.

The HTML code:

<p class="flaming">Long live internet!</p>

To see the demo.

Last Updated on Monday, 18 July 2011 23:25