Freecodecamp: closing body tag not required for head & body of html lesson

Created on 2 May 2017  路  4Comments  路  Source: freeCodeCamp/freeCodeCamp

Challenge Name

http://beta.freecodecamp.com/en/challenges/basic-html-and-html5/define-the-head-and-body-of-an-html-document

Issue Description

The solution does not require a closing body tag

Browser Information

Chrome v58, Window 10 desktop

  • Browser Name, Version:
  • Operating System:
  • Mobile, Desktop, or Tablet:

Your Code

<!DOCTYPE html>
<html>
  <head>
  <title>The best page ever</title>
  </head>
  <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>  

discussing

Most helpful comment

It's perfectly valid code, and not having a closing tag on any of the HTML tags is OKAY, and most browsers will not throw any errors per say.

Having said that I acknowledge what you have pointed out is NOT a good practice as well. But, at freeCodeCamp, our focus is not on best practices in the challenges themselves, where we limit the scope to just teaching basic concepts.

Anything above that is going to confuse campers, especially those who are new to coding.

At the same time, we do feel that these best practices should be and have been taken up through other mediums like our videos on Youtube (we have some challenges too for those), blogs and wiki articles.

Challenges have a strict scope to which this query does not fall into because we sure could check the closing tag, but we would have to do that for every tag, which is a huge infrastructure challenge itself, and divulges the focus on the core curriculum

Thanks once again for reporting.

/cc @freeCodeCamp/moderators Please close if you agree.

All 4 comments

Sometimes the code will still run if it is basic. It will cause problems later on down the road if you don't ad the tag.

It's perfectly valid code, and not having a closing tag on any of the HTML tags is OKAY, and most browsers will not throw any errors per say.

Having said that I acknowledge what you have pointed out is NOT a good practice as well. But, at freeCodeCamp, our focus is not on best practices in the challenges themselves, where we limit the scope to just teaching basic concepts.

Anything above that is going to confuse campers, especially those who are new to coding.

At the same time, we do feel that these best practices should be and have been taken up through other mediums like our videos on Youtube (we have some challenges too for those), blogs and wiki articles.

Challenges have a strict scope to which this query does not fall into because we sure could check the closing tag, but we would have to do that for every tag, which is a huge infrastructure challenge itself, and divulges the focus on the core curriculum

Thanks once again for reporting.

/cc @freeCodeCamp/moderators Please close if you agree.

Fair point! Thanks again for all your hard work.

I can pass this challenge with no body element at all.

Was this page helpful?
0 / 5 - 0 ratings