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

CSS

HTML-adding a headline

Is this not how you add a headline, right after the body? <body> text here</body> <h1>Once Upon a Time</h1>?

Foday, The body tags of an html file should encompass all viewable content displayed by the browser. Here is an example:

<html>

  <head>
    <title>This is the page title</title>
  </head>

  <body>
    <h1>This is a header</h1>
    <p>This is a body of text</p>
  </body>

</html>

Hope this helps! -Charles

Excellent! Thank you, Charles Kenney. So is what and how I'm in putting the code incorrect? "<body> <h1>Once Upon a Time</h1>

The quiz is saying how I'm inputting the tag is incorrect and I've tried moving spaces and proper alignment and nothing seems to take.

<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title><Once Upon a Time</title> <style> h1 {text-align:left; color:green} </style> </head> <meta charset="utf-8"> <title><Once Upon a Time</title> <style> h1 {text-align:left; color:green} <style> <body> <h1>Once Upon a Time</h1> <----I DID THIS Blah Blah Blah </body> </html>

3 Answers

There are a few errors in your html. I'm going to try my best to sort them out for you!

This is the HTML you gave me:

<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8"> 
    <title><Once Upon a Time</title> You left a stray tag opening after your closing title tag 
    <style> h1 {text-align:left; color:green} </style> you did a great job with implementing this css
  </head>
  <body>
    <h1>Once Upon a Time</h1> <----I DID THIS Blah Blah Blah <!--you did not comment correctly, this is an example-->
  </body>
</html>

If we format the html correctly and apply the suggested changes, we get this:

<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8">
    <title>Once Upon a Time</title>
    <style>
      h1{
      text-align:left;
      color:green
      }
    </style>
  </head>
  <body>
    <h1>Once Upon a Time</h1> <!--I did this blah blah blah -->
  </body>
</html>

Here is a screenshot of the example HTMLs output.

Let me know if you need anything else! -Charles

Jennifer Nordell
seal-mask
.a{fill-rule:evenodd;}techdegree
Jennifer Nordell
Treehouse Teacher

Hi Charles! I'm changing your comment to an answer so that the question can be marked in the forums as "answered" and so that it may be eligible for voting/best answer assignment :sparkles:

oops. Thanks Jennifer!

Cheers, Charles Kenny!. I will try this again with your suggestions.

I understand now that I simply needed to input the information within the body. Great! explanation, Charle Kenneys. I shall continue my path, speak again soon I hope.