HTMLs Tutorial

HTML Tutorial HTML Tags HTML Basic Tags HTML Attributes HTML Elements HTML Formatting HTML Text Format HTML body tag HTML samp tag HTML script Tag HTML section tag HTML select tag HTML source tag HTML span tag HTML strike tag HTML strong tag HTML style tag HTML sub tag HTML summary tag HTML sup Tag HTML svg tag HTML table tag HTML u tag HTML Headings HTML Paragraphs HTML wbr tag HTML Anchor HTML Image HTML Lists HTML Ordered List HTML Unordered List HTML Form HTML Form input HTML with CSS HTML Layouts HTML References HTML Frames HTML Links Fieldset Tag in HTML Basic HTML Tags Br Tag in HTML Free HTML Templates How to Create a Table in HTML HTML Calendar HTML Card HTML Cellspacing HTML Center Image HTML Checkbox Read-only HTML Cleaner HTML Code for a Tab HTML Comment HTML Compiler HTML Nested Forms HTML Overlay Text on the Image HTML Select Option Default HTML Snake Game HTML Subheader HTML Tab Character dd Tag in HTML How Many HTML Tags are There HTML Align Tag HTML Responsive HTML Tab Code HTML Table Alternate Row Color HTML Table Fix Column Width Contact HTML DL Tag in HTML How to Insert Image in HTML HTML Background Color HTML Dark Mode How to Convert HTML to PNG HTML Data Toggle HTML Email Template HTML Font Color HTML Font Family ID and Class in HTML HTML Tab Space HTML Tab Tag HTML Itemprop HTML Itemscope HTML Form Design HTML Input Only Numbers HTML Textarea HTML to JPG HTML to Markdown Python li Tag in HTML MDN HTML What is the Correct HTML for Making a Hyperlink? What is the Root Element of an HTML Document How to Make a Box in HTML How to Save HTML Files in Notepad How to Align Text in HTML How to Change Font Color in HTML? How to Change Font Size in HTML How to Change Image Size in HTML How to Create a HTML Page How to Create a Link in HTML File? How to Create an HTML File? HR Tag in HTML HTML Base Tag HTML Default Attribute HTML Hyperlink HTML Indent HTML Injection Payloads HTML Input Numbers Only HTML Roadmap HTML Row Height HTML Schedule HTML Space HTML Tab HTML vs HTTP HTML5 API HTML5 Video HTML Collection to Array Text Area in HTML

HTML5 Advance

HTML5 Tutorial HTML5 Tags HTML Button Tag HTML canvas Tag HTML caption Tag HTML City tag HTML Tag HTML5 SVG HTML Event Attribute HTML5 Audio HTML5 Youtube HTML5 Button Tag HTML5 Tags

Misc

How to add JavaScript to HTML How to change font in HTML How to change text color in HTML HTML Date HTML Hide Element HTML Nested Table HTML Reset Button What does HTML stand for? HTML Background Image HTML Tag Div Tag in HTML How to insert Image in HTML How to create a link with no underline in HTML How to insert spacestabs in text using HTMLCSS HTML tag HTML Code HTML Tag HTML Canvas Design a tribute page using HTML and CSS What is a Container tag Font tag in HTML Difference between HTML and DHTML Empty Tag in HTML HTML Button Link Html Line Break Img src HTML Nested List in HTML Placeholder in HTML TD in HTML HTML Space Code HTML Target Attribute HTML Tag Markup Meaning in HTML Border-Collapse in HTML HTML Onclick Online HTML Compiler Convert HTML to PDF HTML Formatter HTML5 - Web Storage HTTP – Responses Container Tag in HTML DL Tag in HTML Horizontal Rule HTML HTML Tab Text Html Table Cell Background Color HTML Table Cell Color HTML Col Width How Many HTML Tags are There Convert String to Unicode Characters in Python HTML Runner HTML Style Attribute HTML Superscript Attribute HTML tabindex Marquee Tag in HTML HTML Dynamic Form HTML side Tag HTML Pattern Attribute HTML q Tag HTML Readonly Base 64 Encoding in HTML Documents Enhancing Data Portability and Security Evo Cam Web Cam HTML Free code camp HTML CSS How to Add a JS File in HTML? How to Add Picture in HTML How to Add the Logo in HTML? How to Add Video in HTML HTML Class Attribute HTML Entities HTML Form Elements HTML Form Templates HTML Marquee Tag HTML Radio Buttons HTML Text box HTML to JSX HTML Tooltip Basic HTML Codes How to Align Image Center in HTML HTML Header Tag HTML Image Tag HTML Next Line

What is the Root Element of an HTML Document

Introduction

The tag in HTML defines the root of an HTML or XHTML page. The browser is informed that this is an HTML page via the tag. It is the second outer container for all content that follows the tag in an HTML document. Starting and ending tags are necessary for the tag.

What is HTML?

HTML stands for Hypertext Markup Language. It is the most widely used markup language for creating pages, websites, and web applications. Tim Berners-Lee proposed HTML in 1990, and W3C recommended it in 2014.

Web pages are written using HTML, which uses plain text and tags with structure to command the web browser how to display the content. In HTML, all these tags are used for page element identification, such as lists, headings, paragraphs, links, and various media and image types.

HTML tags can be empty or have two tags inside of them that carry content. An empty tag, which begins with <> and ends with, is the most prevalent HTML tag. It is also referred to as an element or an HTML element. For instance:

<html>

</html>

What is the Root Element of an HTML Document?

The HTML element is the root element of an HTML document. It is the beginning point for parsing the document and contains all other parts.

The head and body elements of the HTML element must be children.

Text and image content are found in the body element, whereas the metadata, such as the title, meta tags, and scripts, are found in the head element.

Each HTML element needs to have a start tag and an end tag that adhere to these specifications:

<html>…</html> — Starts with <html>, ends with </html>.

<head>…</head> — Starts with <head>, ends with </head>.

<body>…</body> — Starts with <body>, ends with </body>.

The entire HTML element can be empty if it has no required Meta data or content.

Example

<html>

<head>

            <title>

                        What is the Root Element of an HTML Document?

            </title>

</head>

<body style="text-align: center;">

            <h1 style="color: blue;">

                        Javatpoint

            </h1>

            <p>

                        Example

            </p>

</body>

</html>

Output

What is the Root Element of an HTML Document

The head element contains the document's metadata, stylesheets, scripts, character set, title, and other elements.

It has additional metadata in addition to the head title, which is the HTML document title. A concise title that accurately summarises the page's information is ideal. It could appear in search engine results listings, the browser's tab, or window title bar, or both.

Furthermore, the head element has a description of the document, which includes its encoding character, any stylesheets being used, and any scripts used to make the document interactive.

<head>

<title>Document Title</title>

<meta name=”author” content=”Author Name” />

<meta name=”keywords” content=”Keywords” />

<meta name=”description” content=”Description goes here” />

<!- Scripts ->

<script> alert(‘Hello World’); </script>

<!- Stylesheets ->

<link rel=”stylesheet” href=”stylesheet.css” type=”text/css” />

</head>

The content of a document or application is contained in the element. Together with other objects displayed in a web browser, the body houses all viewable material, such as text and graphics.

This is the element that represents the content of an HTML document. CSS uses the body element to define its header and footer as well as to add all the elements that constitute the content of the document.

An Element of the webpage is a container of all other elements. All of your information, including text and images, should be housed in the "body" of your HTML page. Every HTML document has a body section, but it may be empty.

The element that acts as a container for all other components in an HTML document should be distinct. There is only one child in the element, which is always an element.

The usage of the tag is demonstrated in the example below:

<html>

<head>

</head>

<body>

First line <br/> second line <br/> third line <br/> fourth line <br/>

</body>

</html>

Web developers can communicate to modern browsers the structure of their HTML documents by means of doctype declarations.

An HTML page must have the doctype declaration before the root element.

It is not appropriate to validate an HTML document using the doctype declaration. This is because a web page with the incorrect doctype declaration could include erroneous HTML yet pass any W3C-conformant validator. For instance, having a <a> property or a <img> tag without an alt attribute would result in accessibility issues, yet the W3C validator will not detect these errors:

<html>

<head> … </head>

<body>

<h1>Header</h1>

<p>

<img usemap=”#map” src=”…” />

</p>

<a href=”http://www.javatpoint.com">Javatpoint</a>

</body>

</html>