What Should Be the First Tag in Any HTML Document?

Overview
While writing any HTML program we use the HTML tag <html> </html> as the first tag. The HTML tag is also known as the root of the HTML document and it is used first because we want the web browsers to know that the given document is HTML.
Syntax
The syntax of an HTML document is almost the same and very simple. Firstly we start any HTML document by using an HTML tag followed by the head, title and body. We can also have additional tags depending upon our requirements.
Basic Skeleton of every Web Page
As discussed earlier the basic structure or flow of every web page is almost the same. There are a few necessary details that we need to give while making our web page. These details include:
- Making web browser aware that this is HTML document (Thus we start by <html></html>, HTML tag)
- Stating the title of our web page (We use <title></title> , title tag for that)
- The machine-readable information about HTML document like title, scripts, stylesheets etc. (We use <head></head>, head tag for that).
- Finally giving the content that will be shown on our web page (We use <body></body>, body tag for tag)
Again there might be many other tags getting used in the HTML document but it depends on the user requirements.
Example of HTML tag
The HTML tags are special keywords written inside angle brackets (<>) that tells about type of content present in the webpage. There are many types of tags like <html></html> tag,<head></head> tag etc.
Let's look at an example of how the program written in HTML looks like in a browser:
The input code is:
The output on the webpage is:

Supported Browsers
Nowadays almost all web browsers support HTML. Some of the popular ones are
- Google Chrome
- Mozilla Firefox
- Internet Explorer
- Safari
- Microsoft Edge
- Opera etc.
The latest version of HTML that is HTML5 is mostly supported in the newer versions of these browsers like Chrome version 61 to 70 supports HTML5. Similarly, Firefox version 4 to 63 partially supports HTML5 form features property and Safari browser version 10.1 to 12 supports HTML5 form features.
Learn More
For more information about HTML and HTML tags you can articles on Scaler topics like
Conclusion
Thus so far we discussed that:
- First tag in any HTML document is <html></html> (HTML tag).
- It is also known as root element of the document.
- We use it as first tag because it helps browsers recognise that a given document is a HTML document.