06. Decorating Text text-decoration, text-shadow

Let's now discuss the two ways in which we can decorate our text.

Lines under, over, and through our text

We can apply decorations to our text with the text-decoration property. The values include: none, underline, overline, and line-through.

We can take this a step further and add color the line with the text-decoration-color property.

p {
  text-decoration: underline;
  text-decoration-color: pink;

Hello Venus!

Adding a Drop Shadow

To add a drop shadow behind your text, we can use the text-shadow property.

p {
  text-shadow: 3px 3px 1px blue;

The property takes three lengths and a color:

  1. The first length tells how far to the left/right the shadow should fall.
  2. The second length is the distance to the top or bottom that the shadow should fall.
  3. The third length is optional, and specifies the amount of blur that should be applied.
  4. Lastly, you may choose the color of the drop shadow with the fourth value.

Hello World!

Build modern and responsive webpages

The Modern Web

Build modern and responsive webpages Try Front-end

The Modern Web will guide you through the most important tools of device-agnostic web development, including HTML5, CSS3, and JavaScript. The plain-english explanations and practical examples emphasize the techniques, principles, and practices that you'll need to easily transcend individual browser quirks and stay relevant as these technologies are updated.

$ Check price
34.9534.95Amazon 4.5 logo(30+ reviews)

More Front-end resources

Aching back from coding all day?

Prism Glasses

Aching back from coding all day? Try Back Problems

Ever feel achy from sitting crunched up on your computer table? Try lying down with these optical glasses that allow you to work on your laptop while lying flat on your back. This is the perfect solution with those with limited mobility or those who wish to prevent neck cramps and back strains.

$ Check price
4.454.45Amazon 4 logo(128+ reviews)

More Back Problems resources