Locked lesson.
About this lesson
Exercise files
Download this lesson’s related exercise files.
Shadows.docx58.8 KB Shadows - Solution.docx
59 KB
Quick reference
Shadows
Shadows are a great way to add a little design to CSS.
When to use
You can use shadows any time you want to highlight something.
Instructions
We already know how to do basic text shadow.
Here's how to create an outline of text with shadows:
h2 {
color: white;
text-shadow: -1px 0 black, 0 1px black, 1px 0 black, 0 -1px black;
}
Here's how to create a box shadow:
div {
background-color: green;
box-shadow: 10px 10px 20px;
padding: 20px;
}
Hints & tips
- Text can have shadows with text-shadow
- Boxes can have shadows with box-shadow
Lesson notes are only available for subscribers.