HTML Tag


The <html> tag in HTML is the root of the HTML page or document and is considered as the container for all the other HTML elements.

Let us now see an example to implement the <html> tag −

Example

 Live Demo

<!DOCTYPE html>
<html>
<head>
<title>Document Title comes here</title>
</head>
<body>
<h1>
   Heading comes here
</h1>
   Content comes here
</body>
</html>

Output

In the above example, at first, we have set the doctype −

<!DOCTYPE html>

After that the <html> tag is used to set other elements inside it, including <head> −

<html>
<head>
<title>Document Title comes here</title>
</head>

Now the <body> tag is used to set the content −

<body>
<h1>

Heading comes here
</h1>
Content comes here

The <body> tag is closed and finally the HTML document ends with the closing tag −

</body>
</html>

Updated on: 30-Jul-2019

113 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements