HTML - tags - html tag

revision:


Content

"html" tag : a container for all elements in HTML document syntax some examples


"html" tag : a container for all elements in HTML document

top

The <html> tag represents the root of an HTML document. The tag is the container for all other HTML elements (except for the <!DOCTYPE> tag). You should always include the "lang" attribute inside the <html> tag, to declare the language of the Web page. This is meant to assist search engines and browsers. Before the <html> tag we can only use <Doctype> declaration, which gives information about the HTML version to the browser.

Attributes: the <html> element supports the global attributes.


Syntax

top

<html> . . . </html>


some examples

Codes:

                    <html lang="en">
                        <head>
                        <title>Title of the document</title>
                        </head>
                        <body>
                        <h1>This is a heading</h1>
                        <p>This is a paragraph.</p>
                        </body>
                    </html>
                

Codes:

                    <!DOCTYPE html>  
                    <html>  
                    <head>  
                        <title>HTML tag</title>  
                    </head>  
                    <body>  
                        <h2>Example of HTML tag</h2>  
                        <p> Write your main Content within Body of the HTML document. </p>  
                    </body>  
                    </html>