Follow this guide to learn how to add a text shadow to a website using the text-shadow
CSS property!
Follow these steps to set up a new project for text shadows.
class
attribute to the second <p>
element that says “Style this paragraph…”class
to be update
<style></style>
element.update
as the selector{
and }
)At this point, the added code should look something like this:
HTML
<p class="update">Style this paragraph...</p>
CSS
.update {
}
The project should be ready for styling.
The cool thing about the text-shadow
property is that there are a ton of different possibilities. You can control the color, location, and blur of the shadow!
It looks something like this:
text-shadow: 1px 4px 8px blue;
Here is what each item does:
1px
in the example): position of the horizontal shadow4px
in the example): position of the vertical shadow8px
in the example): how much to blur the shadowblue
in the example): the color the shadow should beAdding the property example above to a piece of text would make it look like this:
Now, put some of that code in the Glitch project.
<style></style>
element.update
ruleset (between {
and }
), create a new property declaration with text-shadow
text-shadow
property to be 1px 4px 8px blue
Load up the page, and see the shadow appear! The code within the <style></style>
element should look something like this:
.update {
text-shadow: 1px 4px 8px blue;
}
Try playing around with the different values to see where it leads.
Click here for an interactive text-shadow
generator tool! This site will allow you play around with the values, and will give you code to copy and paste at the end.