Skip to main content
Crowdfunding
Python + AI for Geeks
Practice

Changing Text Color

To change the color of text, use the color CSS property.

Let's add a color property to the intro class to change the text color to blue.


Changing text to blue with the color property
.intro {
font-weight: normal;
font-size: 20px;
line-height: 1.8;
color: blue;
}

You'll see that the text within the h1 tag has changed to blue.

If you prefer another color, try changing the color to grey, green, or any other color you like.

Removing the color property will revert the text back to black.

Want to learn more?

Join CodeFriends Plus membership or enroll in a course to start your journey.