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 trialAarica Hammond
5,115 PointsHow to properly add the <h1> in the HTML
is it <h1>Once Upon a Time</h1>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Once Upon a Time<body></body>
<style>
{text-align:left; color:green}
<body> <!-- * -->
<h1>Once Upon a Time</h1> <!-- * -->
</body> <!-- * -->
</style>
</head>
<!-- move * to here -->
</html>
2 Answers
Steve Hunter
57,712 PointsHi there,
You need to move your body
tags to after the closing head
tag. Your h1
then goes inside the body
.
Make sense?
Steve.
Steve Hunter
57,712 PointsOK, let me try to explain.
You start the challenge with this code:
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Once Upon a Time</title>
<style>
h1 {text-align:left; color:green}
</style>
</head>
</html>
The challenge asks you to Start by writing an opening and closing body tag below the closing head tag, and above the closing html tag.
So, that code needs to be inserted where I've indicated below, i.e. after the closing head
tag, </head>
:
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Once Upon a Time</title>
<style>
h1 {text-align:left; color:green}
</style>
</head>
<!-- HERE!! -->
</html>
You have added the body
tag inside the style
part of the html code.
You have written the correct code with this:
<body>
<h1>Once Upon a Time</h1>
</body>
But you have put it in the wrong place. Move that block of code to where I wrote <!-- HERE!! -->
and your code will work.
Steve.
Steve Hunter
57,712 PointsSteve Hunter
57,712 PointsI added come asterisks & comments in your code to show you what to move where.
Aarica Hammond
5,115 PointsAarica Hammond
5,115 PointsNot quite sure what you mean