What should be the first tag in any HTML document?

What should be the first tag in any HTML document?
Table of Contents

You are a complete beginner to HTML and you are looking answer for the question What should be the first tag in any HTML document? today I will provide you a answer to your question so follow up with me till the end.

We will not waste much time but if you have seen the HTML boilerplate code which is there in all HTML documents if you have not below is the the basic HTML boilerplate code which exists in all HTML pages.

				
					<!DOCTYPE html>
<html lang="en">
  <head>
    <title>HTML Boilerplate</title>
  </head>
  <body>
    <h1>Hello world</h1>
  </body>
</html>
				
			

As you can see in the above HTML code <!DOCTYPE html> is the first line does that means that it is the first tag in a HTML document the answer is no because <!DOCTYPE html> is not a HTML tag it is just a declaration which instructs the browser which HTML version is the page written in.

So now the second tag is <html> which is a HTML tag and all the HTML code is written inside this tag so the first tag in any HTML document should be <html> and also the end tag of any HTML document should be </html>.

				
					<-- FIRST HTML TAG TO BE ENTERED -->
<html>
				
			

I hope you found this guide helpful and you found your answer to your question which is what should be the first HTML tag which is <html> as I have said.

Here are more guides which you may find helpful:

Want more solutions and guides like this then join our coding community on Telegram to get latest blog updates and more – Join Telegram channel.
Share This Post
Share on facebook
Share on twitter
Share on email
Share on whatsapp

Leave a Reply

Subscribe To Our Newsletter

Get updates and learn from the best

Latest Guides & Articles