Horje
Omitting <html> and <body>

An HTML page will validate without the <html> and <body> tags:


Example of Omitting <html> and <body>

index.html
Example: HTML
<!DOCTYPE html>
<head>
  <title>Page Title</title>
</head>

<h1>This is a heading</h1>
<p>This is a paragraph.</p>

Output should be:

Example of Omitting <html> and <body>

However, we strongly recommend to always add the <html> and <body> tags! Omitting <body> can produce errors in older browsers. Omitting <html> and <body> can also crash DOM and XML software.





Category:
Web Tutorial
Sub Category:
HTML Style Guide
Uploaded by:
Admin


Read Article
https://develop.horje.com/learn/1434/reference