Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

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

i don't know how to change paragraph tag to an h1 tag

how to start this challenge

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

    <p>Welcome to My Web Page!</p>

  </body>
</html>
styles.css

Hi Raviraj,

A paragraph tag is a <p> tag, and the paragraph is everything in between the <p> and </p>.

A heading 1 tag is a <h1> tag, and the heading is everything in between the <h1> and </h1>.

In this example you would change the paragraph into a h1 by simply changing the tags <p> and </p>.

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

    <h1>Welcome to My Web Page!</h1>

  </body>
</html>

Hope that helps. Happy Coding

KB :octopus:

thanks kieran

3 Answers

To change the colour of the h1 then you can either add this in a style attribute (there is usually no good reason to do it this way):

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

The better way would be within your css file, so in the example above, the following code would go in your styles.css file:

h1 {
   color: red;
}

Doing it via the css file, is the better method as it keeps all of your styles in one place, meaning one place to make changes and also allows for consistency across the site. For instance if you wanted all your h1 content to look the same its a single change.

Hope that helped

KB :octopus:

ohh!! thank u so much

No problem Raviraj - happy to help.

KB :octopus:

can you tell me how to change color of h1

How do I do this style change for the color purple? <h1> style="color:purple;>" Welcome to My Web Page!</h1>