Lets start discussion about the first HTML5 tag. Before starting please keep in your mind that tags are two types – ‘opened tags’ and ‘closed tags’. Tags those don’t have got any closing tags are called opened tags. Examples of opened tags are <br>, <img> etc. On the other hand, tags those have got closing tags are called closed tags. For examples <html>, <head>, <body> etc are closed tags. <html> tag has got it’s corresponding closing tag </html>.
The html tag (<html>) is the root element and it is the container of all other HTML5 elements or tags. All the other HTML5 tags need to be written in between <html> and </html>. The html tag informs browser that the document is a HTML document.
For example below we have shown a simple HTML5 code snippet with html tag for creating a simple web page:
<!DOCTYPE html> <html> <head> <title>HTML5 page title</title> </head> <body> HTML5 page content </body> </html>
There are few attributes of the html tag. One of the most widely used attribute of html tags is ‘lang’. How this attribute is used has been shown below. ‘en’ represents the language ‘English’.