You are on page 1of 4

3/30/2020 Playing | Introduction to HTML

HTML5 Document

HTML5 Document Parts


HTML document or Page is always containing some basic structural elements all the time.
Without this element, any HTML page does not work properly. Any HTML page is mainly on the
below four main elements which need to be always maintained in any HTML page.

Document Type Declaration

Document Type Declaration is the first part of any HTML page. Most often it is known as
DOCTYPE. Basically, Document Type Declaration or DOCTYPE is used to pass the instruction to
the browser that the related document is an SGML or XML document. It is not an HTML tag. It is
used to provide the version of the HTML used in the web page for the browser. It is required
from HTML 4.0 onwards for specifying the Document Type Definition (DTD) of the page.

Syntax

1. <!DOCTYPE html>

HTML Element

After providing the Document Type Declaration in the HTML web page, we need to provide the
HTML element in the page. All the HTML page always start with the HTML element tag i.e.
<html> and ends with the </html> tag. This html tag indicates that the document contains the
HTML markup language code.

Syntax

1. <html></html>

The Head Element

This part mainly contains all the header element along with metadata of a web page. The
<header> tag contains all the information related to the header part of the web page.

Syntax

1. <head></head>

Title Element

https://www.dotnettricks.com/player/html/html-introduction-getting-started 1/4
3/30/2020 Playing | Introduction to HTML

Title Element
HTML5isDocument
used to provide the title of web document.

Syntax

1. <title></title>

Meta Elements

The meta elements in the HTML documents are used to provide a structural description about a
web page like author name, page description etc. The metadata tags are used by browsers,
search engines or other web services.

Syntax

1. <meta name="viewport" content="width=device-width, initial-scale=1.0">

Scripts Elements

The Script element is used under the header tag in the HTML documents. This tag is normally
used to attach any external JavaScript files with the web page. These scripts files may execute at
the time of document load or a later time.

Syntax

1. <script></script>

Style Elements

The Style element is used under the header tag in the HTML documents. This tag is normally
used to attach any external Stylesheet or CSS files with the web page.

Syntax

1. <style></style>

Body Elements

This Part mainly contains all the information required to display on the web page. The <body>
contains all the details information of the web page which will display to the browser.

Heading Elements

https://www.dotnettricks.com/player/html/html-introduction-getting-started 2/4
3/30/2020 Playing | Introduction to HTML

The heading
HTML5tags are used to define the important heading of the web document. The heading
Document
tags can be defined by using <h1> to <h6> tags. <h1> defines the most important heading tags
whereas <h6> defines the least important heading.

Syntax

1. <h1>Heading</h1>
2. <h2>Heading</h2>

Paragraph Elements

The paragraph tags are used to define the paragraph contained within the web document.

Syntax

1. <p>code contains</p>

In the below code snippet, the basic structure of any HTML documents demonstrate.

1. <html>
2. <header>
3. <meta charset="UTF-8">
4. <meta name="description" content="First Web Page">
5. <meta name="keywords" content="HTML,CSS,XML,JavaScript">
6. <meta name="viewport" content="width=device-width, initial-
scale=1.0">
7. <title>
8. Welcome to HTML
9. </title>
10. </header>
11. <body>
12. <h1>Welcome to HTML</h1>
13. <h2>This is the first page created in HTML</h2>
14. <p>
15. This paragraph contains a lot of spaces
16. in the source code,
17. but the browser ignores it.
18. </p>
19. </body>
20. </html>

https://www.dotnettricks.com/player/html/html-introduction-getting-started 3/4
3/30/2020 Playing | Introduction to HTML

https://www.dotnettricks.com/player/html/html-introduction-getting-started 4/4

You might also like