HOME C C++ PYTHON JAVA HTML CSS JAVASCRIPT BOOTSTRAP JQUERY REACT PHP SQL AJAX JSON DATA SCIENCE AI

CSS Text Shadow

CSS text-shadow is a property that allows you to add a shadow effect to the text of an HTML element. It can be used to enhance the visual appearance of text by creating a shadow behind it. The text-shadow property takes a set of values to define the offset, blur radius, and color of the shadow.

Example

h1 {
  text-shadow: 2px 2px;
}
You can click on above box to edit the code and run again.

Output

Text-shadow effect!

Next, add a color (red) to the shadow:

Example

h1 {
  text-shadow:  2px 2px red;
}
You can click on above box to edit the code and run again.

Output

Text-shadow effect!

Then, add a blur effect (5px) to the shadow:

Example

h1 {
  text-shadowv: 2px 2px 5px red;
}
You can click on above box to edit the code and run again.

Output

My First Heading

My first paragraph

More Text Shadow Examples

Example

Text-shadow on a white text:


h1 {
  color: white;
  text-shadow: 2px 2px 4px #000000;
}
You can click on above box to edit the code and run again.

Output

Text-shadow effect!

Example

Text-shadow with red neon glow:


h1 {
  text-shadow: 0 0 3px #ff0000;
}
You can click on above box to edit the code and run again.

Output

Text-shadow with red neon glow!

Example

Text-shadow with red and blue neon glow:

h1 {
  text-shadow:   0 0 3px #ff0000, 0 0 5px #0000ff;
}
You can click on above box to edit the code and run again.

Output

Text-shadow with red and blue neon glow!

Example

h1 {
  color:  white;
  text-shadow:  1px 1px 2px black, 0 0 25px blue, 0 0 5px darkblue;
}
You can click on above box to edit the code and run again.

Output

Text-shadow effect!