I added <body> to my page as instructed but I am not passing step one. Why?



I added <body> to my page as instructed in this exercise but I am not passing step one. Why?


Be sure to create both an opening tag (<body>) and a closing tag (</body>) for this element. Take another careful look at the code snippet on display in this lesson. Notice how both the opening and closing body tags are nested within the html tags? Notice how indentation is being used here? You are going to want to follow suit.

FAQ: Learn HTML Elements - Intro to HTML - The Body

would an opening tag (<p>) and a closing tag (</p) be always be display this way and why? …why is it says <body> when its really<p>?


The BODY element is the outermost container of the content portion of the document. The P element is content nested in the body, as it should be. A valid HTML document has only one BODY, but has no limit on content.

  <p>This is page content (a paragraph) nested in the BODY element.</p>


Thanks! I finally understood this once I moved along the lesson :slight_smile:


What is the standard indentation for nesting? In this case for the p tag under the body tag?


Because there is a lot of nesting in typical HTML document, the accepted standard is two spaces per level.



It still wont work for me. What am I doing wrong?


Link to lesson, please, as well, post your HTML so we can test it.


Hi, why do we have to use both opening and closing tags, < body>,</ body>,< p> and </ p>, for displaying content? I tried it without the body tags and the content still displays on the webpage. What’s the difference between the two tags?


This question goes against the grain of well-formedness in documents facing the web. There are some rare instances where closing tags are not mandatory, but on the whole, our documents should follow strict guidelines and use closing tags where expected.

Take for instance list items and paragraphs.

    <li>list item
    <li>list item
    <li>list item
    <li>list item

List items are easy to separate using only the OPENTAG, but in the above, the </ul> and </section> ENDTAGs must be present or the document will not validate. LIkewise,

  <p>Lorem ipsum
  <p>Lorem ipsum
  <p>Lorem ipsum
  <p>Lorem ipsum

paragraphs are also easily distinguished by their OPENTAG. Again, the </h1> and </section> ENDTAGs are required or the document will not validate.

Loose paragraphs and list items may be okay, but in the fast changing world we should never take for granted that every user agent will be forgiving of missing endtags. If the spec calls for it, then use it, without question and you will get less surprises in future.


A post was split to a new topic: Why no error?


My problem: Not the code itself, but the fact that I had not pressed “Run” yet.


If given enough time to time-out, the lesson auto-runs when we resume coding. That is a big time fly in the ointment as many members will contend, and one we have long been requesting would be rectified.

Reset the lesson, and do it again would be my advice.


A valid HTML document has only one BODY, but has no limit on content.

Ref to your above message , I am revising this course (doing it all over again) and closer to the end I do recollect noticing how more than 1 BODY are created in a single HTML document with the intent to separate long codes- or rather break down long complicated data

Please do clarify on this


https://dev.w3.org/html5/html-author/#the-body-element The body element

The body element represents the main content of the document.

Start tag: optional
End tag: optional

Categories: Sectioning root.

Contained By: As the second element in an html element.

Content Model: Flow content.

The operative term is bolded. There is no second, ‘second element’.

That stipulation aside, it is possible to have two body elements if there are two html elements. This is done in an <iframe></iframe> element. Use the link above to search the site for that element and see how an html document can contain another html document.

The learning environment of the main CC site is a perfect example of this. Our webpage (the one we see) is actually embedded in another webpage, the one with a single URL. The embedded page has our token in the URL and can only be reached internally on CC’s servers. That’s an approximation, at least. The key is the iframe.


sorry but my knowledge of computing is rather basic…I did not follow what you being said

              < first element (metadata)
              < second element (main content)


great…much simpler now
thank you for your assistance…:slight_smile: