HTML Introduction to HTML and CSS Getting Familiar with HTML and CSS Test: Changing the Look of a Web Page

change the color tag of h1 to purple

change the color of h1 to purple

<!doctype html>
    <link href="styles.css" color:purple; rel="stylesheet">
    <h1>Welcome to My Web Page!</h1> 

h1 {
  color: blue;
Brandon Gormley
Brandon Gormley
6,147 Points

Hey Naima,

The color attribute will not work in the link tag. For inline CSS it must be placed inside a style tag such as

<h1 style="color:purple;"> Welcome to My Web Page!</h1>

1 Answer

Nils Kriedner
Nils Kriedner
Full Stack JavaScript Techdegree Student 24,331 Points

Hi Naima,

the <link> tag in the head of your html document ist not used for styling. You use it to link to your stylesheet, so the effects of the stylesheet will take effect in your html document.

So first of all delete the color attribute from the <link> tag!

Then in your css declaration you did a good job declaring the color for the h1. The syntax is correct, but you declared "blue" instead of "purple" which is what is asked in the challenge.

So the second thing to do: Change the color attribute to "purple".

Then everything should work!

Happy coding!

PS: You can upvote my post and/or mark as "best answer" (at the bottom of my post) if it helped you. :-)