HTML Hello World

Here is a simple hello world example, that explains the basic structure of an HTML document.

HTML5 Document structure must include

  • Must start with document type declaration <!DOCTYPE html>
  • Element html is the root, which includes head and body elements
  • Element head contains the title, meta tags, and links to CSS styles of a document.
  • Element body contains all visible content of a document.

NOTE: We have used the element h1 to display “Hello World!!” as a heading, and will discuss more of them in further videos.

<!DOCTYPE html>
<html>
<head>
</head>
<body>
    <h1>Hello World!!</h1>
</body>
</html>

Overall

Writing a simple hello world example in HTML is very simple with just a few required elements.