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

Mirza Farrukh Baig
Mirza Farrukh Baig
435 Points

color of h1 heading to purple

how to change the color of h1 heading to purple

index.html
<!doctype html>
<html>
  <head>
    <link href="styles.css" rel="stylesheet">
  </head>
  <body>

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

  </body>
</html>
styles.css
h1 {
  color: blue;
}

1 Answer

Muhammad Tahir
Muhammad Tahir
4,086 Points

Just change the color property in css file.

h1 {
  color: purple;
}

You can also use inline styling as:

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

You can use any of above but it's better to use these within a css file.