Shadow text, for all browsers

Standard CSS 3 text fill attribute and alternative for older browsers.

The shading effect under text characters exists in Internet Explorer 5.5 as an ActiveX filter. It became widespread in all browsers, becoming the property of CSS 3.

Display

Standard code

The text-shadow property is followed by a definition or a comma-separated list of definitions.

You can override the property with the definition: text-shadow: none.

Each definition consists of 4 parameters, two of which are optional.

Demo code:

.tshadow
{
  text-shadow: 1px 1px 2px black;
}

To surround characters with a halo effect:

.halo
{
  text-shadow: 1px 1px 2px black, 0 0 1em gray, 0 0 0.2em gray;
}

Example:

Display

CSS code for all browsers

<style>
.tshadow
{
text-shadow: 1px 1px 2px black;
}
.halo
{
text-shadow: 1px 1px 2px black, 0 0 1em gray, 0 0 0.2em gray;
}
</style>

To access these properties in JavaScript...

object.style.textShadow="1px 2px 2px gray";