How to create an HTML Document?

HTMLWeb DevelopmentFront End Technology

An HTML document defines the structure of HTML web page. It contains two distinct parts, the head, and the body. The head contains information about the document. The body part contains the content of the document, which gets displayed.

Just keep in mind that you should use the head part inside <head>…</head> tags. The body tag is used inside the <body>…</body> tags. Also, an HTML document begins with the <!DOCTYPE html> declaration, which is known as the DTD (Document Type Definition). This is to inform the web browser the type and version of the HTML document.

HTML Document

Example

You can try to run the following code to create an HTML document. The <p> tag defines the paragraph −

Live Demo

<!DOCTYPE html>
<html>
<head>
<title>HTML Document</title>
</head>

<body>
<p>The content gets added here.</p>
</body>
</html>

Output

The content gets added here.
raja
Published on 18-Jan-2018 09:30:24
Advertisements