How to create a valid HTML document with no <head> element?

JavascriptWeb DevelopmentFront End Scripts

With HTML, the essentials are doctype declaration, <html><head> and </body>. But, you will be amazed to know that a valid HTML document can work without the <head> element. The doctype declaration<!DOCTYPE html> will come always since it tells and instructs the browser about what the page is about.

Let’s see an example; here we won’t use the <head> tag. Still, the HTML Document is valid and will work correctly like any other valid HTML Document

Example

Live Demo

<!DOCTYPE html>
<html>
   <title>Title of the document</title>
   <body>
      <h1>This is heading 1</h1>
      <p>This is demo text.</p>
   </body>
</html>
raja
Published on 01-Feb-2018 11:02:59
Advertisements