The following HTML example demonstrates the most basic HTML document. This HTML document uses seven HTML elements.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
<!DOCTYPE html> <html> <head> <title>This is Page Title</title> </head> <body> <h1>Large Title Heading</h1> <p>This is the first paragraph of text in the page.</p> <p>Here is the second paragraph of text in the page.</p> </body> </html> |
The following explains the use of the HTML elements in the example:
HTML Document Structure Elements
<!DOCTYPE html> is a declaration that we are using an HTML5 document.
<html> is the element that marks the beginning of an HTML page.
<head> section contains meta information about the page and more.
<title> is the page title that is shown in the browser tab.
<body> is contains everything that will be visible in the browser.
The body content includes text, images, links, etc.
HTML Text Elements
<h1> is the largest heading text available.
<p> indicates a paragraph and is used to separate text.