Define the Head and Body of an HTML Document1

Can you help I try anything but everything is not right Please little help??

Your code so far


<!DOCTYPE html>
<html>
 <title>
   <head>
     <!-- metadata elements-->
   </head>
 </title>
  <body>
    <!-- metada contents-->
  </body>
  
  
  
  <h1>The best page ever</h1>
  <p>Cat ipsum dolor sit amet, jump launch to pounce upon little yarn mouse, bare fangs at toy run hide in litter box until treats are fed. Go into a room to decide you didn't want to be in there anyway. I like big cats and i can not lie kitty ipsum dolor sit amet, shed everywhere shed everywhere stretching attack your ankles chase the red dot, hairball run catnip eat the grass sniff. Meow i could pee on this if i had the energy for slap owner's face at 5am until human fills food dish yet scamper. Knock dish off table head butt cant eat out of my own dish scratch the furniture. Make meme, make cute face. Sleep in the bathroom sink chase laser but pee in the shoe. Paw at your fat belly licks your face and eat grass, throw it back up kitty ipsum dolor sit amet, shed everywhere shed everywhere stretching attack your ankles chase the red dot, hairball run catnip eat the grass sniff.</p>
  
</html>  

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.87 Safari/537.36.

Link to the challenge:
https://learn.freecodecamp.org/responsive-web-design/basic-html-and-html5/define-the-head-and-body-of-an-html-document

Hi!

The instructions says: “Edit the markup so there’s a head and a body. The head element should only include the title, and the body element should only include the h1 and p.”.

In your code, the title element includes the head element (because head is inside title), and your body is empty, when it has to have the h1 and p elements.

Solution:

<html>
  <head>
        <title>this element is inside the head element</title>
  </head>
  <body>
    <h1>this element is inside the body element</h1>
    <p>this element is inside the body element</p>
  </body>
</html>

Also, the head and body elements are inside the html element!

2 Likes

ohh thanks this help me so much.

1 Like