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 trialRaviraj Singh
Courses Plus Student 136 Pointsi don't know how to change paragraph tag to an h1 tag
how to start this challenge
<!doctype html>
<html>
<head>
<link href="styles.css" rel="stylesheet">
</head>
<body>
<p>Welcome to My Web Page!</p>
</body>
</html>
Raviraj Singh
Courses Plus Student 136 Pointsthanks kieran
3 Answers
Kieran Black
9,139 PointsTo 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
Raviraj Singh
Courses Plus Student 136 Pointsohh!! thank u so much
Kieran Black
9,139 PointsNo problem Raviraj - happy to help.
KB
Raviraj Singh
Courses Plus Student 136 Pointscan you tell me how to change color of h1
Roberto Rivera
10,832 PointsHow do I do this style change for the color purple? <h1> style="color:purple;>" Welcome to My Web Page!</h1>
Kieran Black
9,139 PointsKieran Black
9,139 PointsHi 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>.
Hope that helps. Happy Coding
KB