Odd error in CodePen about body tag

I’m going through a tutorial that uses CodePen, and noticed a red exclamation point at the bottom left of the HTML panel; upon clicking it, it shows error “Just HTML that goes in the goes here.”

image

I already know how the body tag works and where it goes, but I’m not understanding that error in particular where it’s placed. It seems the validation got out of sync somewhere. I’m not seeing what’s wrong with my code there.

Clicking the Learn More link goes to https://blog.codepen.io/documentation/preview-template/, which doesn’t clarify why that error phrased that way is placed there.

Hello there.

Some things to note when using CodePen:

  1. CodePen does not expect any content outside the body tags.
  2. All meta, link, and script information must be put in the :gear: settings section of the HTML editor.
  3. You do not need to/cannot link the CSS in your HTML, if you place the CSS in the appropriate section.
  4. If your project uses React, use the Babel preprocessor, and link the CDN in the appropriate :gear: section.
  5. The editors offer the ability to format and analyze your code, providing useful information about forgotten closing tags etc.

If you are still confused with how to use CodePen, please read the official documentation.

Hope this helps

Thanks, I just stumbled upon another post here that explained it. Unfortunately the tutor is writing full HTML in CodePen and not just the body :laughing: so it seems silly he’s using CodePen to demonstrate meta tags and other tags outside of the body tag.

yeah maybe the person doesn’t know this

Oh, they eventually said that they were doing it because it was easy to demonstrate easy output update with separated HTML/CSS/JS panels. It makes sense now :laughing: Just an annoying distraction at first.

1 Like