Following is an basic example of an HTML document. It contains the essential building-block/Tags (i.e. doctype declaration, HTML, head, title, and body tags) using which web pages are created.
Following is a simple example of HTML;
<!DOCTYPE html>
<html>
<head>
<title>tutobook HTML Example</title>
</head>
<body>
<h1>Example of HTML Tutorial</h1>
<p>Learn HTML in Tutobook.com.</p>
</body>
</html>
Browser output:
Above program explained
- <!DOCTYPE html> – It defines, this document is an HTML document
- <html>: this is a root element of an HTML page; it is mandatory tag which encloses all other tags in the HTML page
- <head>: Head tag includes header of web page and enclosed tags like title and metadata
- <title>: This tag specifies a title of HTML page. Text enclosed in title tag will be shown in the browser’s title bar
- <body>: defines the main body of the page and is a container for all the visible contents, such as headings, paragraphs, lists, etc <h1>: heading Tag
- <p>: paragraph in HTML document