What is the basic minimal structure of HTML document?


HTML document is a web page, which helps you in showing content on the website. It consists of tags, which has an opening as well as closing tags. However, some tags do not come in pairs i.e. they do not have a closing tag. The basic minimal structure also has some tags, which you need to add.


doctype
This is a doctype declaration, which begins the HTML program and gets added as <!DOCTYPE html>. It is added to tell and instruct the browser about the document.
<html
The first thing after the doctype declaration is the <html> tag. All the other HTML tags comes inside the <html>…</html> tag tells. Every tag inside this tag follows HTML rules.

<head>
The <head> tag helps you in adding the title for the HTML document using the <title>…<title> tag.
<body>
The <body> tag allows you need to content to the HTML Document. You can use the <p>…</p> tag to add content to the document, which is visible on the web page.

Example

Live Demo

<!DOCTYPE html>
<html>
   <head>
      <title>HTML Document</title>
   </head>
   <body>
      <p>This is demo text.</p>
   </body>
</html>

Ali
Ali

Updated on: 07-Oct-2019

1K+ Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements