🚨 Get Your Free NFT Certificate Mint by Completing the Web3 Exam! START NOW

Code has been added to clipboard!

html Tag

Reading time 2 min
Published Jun 29, 2017
Updated Jan 20, 2020

html Tag: Main Tips

  • The <html> tags are used to define the root element of an HTML file.
  • The opening tag for the element is placed right after the <!DOCTYPE> declaration in the beginning of the HTML document.
  • You don't need to define the XML namespace in HTML5.

What Is an <html> Tag?

You should notice the <html> tag in the beginning of every HTML document, and the closing </html> tag at its very end:

Example
<!DOCTYPE html>
<html>
<head>

<title>Your document title should be here</title>

<p>Links and scripts go here.</p>

</head>
<body>

<p>This is where you write the main content and other HTML elements.</p>

</body>
</html>

Every HTML document is made up of nested elements. The first and foremost element that you need to nest all other elements to is called the root element. It is the parent or ancestor to every element, but cannot have any parent elements itself. In an HTML document, the root element has to be <html>.

DataCamp
Pros
  • Easy to use with a learn-by-doing approach
  • Offers quality content
  • Gamified in-browser coding experience
  • The price matches the quality
  • Suitable for learners ranging from beginner to advanced
Main Features
  • Free certificates of completion
  • Focused on data science skills
  • Flexible learning timetable
Udacity
Pros
  • Simplistic design (no unnecessary information)
  • High-quality courses (even the free ones)
  • Variety of features
Main Features
  • Nanodegree programs
  • Suitable for enterprises
  • Paid Certificates of completion
Udemy
Pros
  • Easy to navigate
  • No technical issues
  • Seems to care about its users
Main Features
  • Huge variety of courses
  • 30-day refund policy
  • Free certificates of completion

The xmlns Attribute

You can include an xmlns attribute to set an XML namespace for HTML documents parsed with an XML parser:

Example
<html xmlns="http://www.w3.org/1999/xhtml">

However, it is not necessary, as all HTML5 elements are automatically in in the namespace you can see in the example. This attribute is a remnant from XHTML, where it was actually required to include.

In HTML5, you can add it or skip it – the page will be displayed in the same manner, no matter which browser the website visitor is using.

Browser support

Browser image
Chrome
All
Browser image
Edge
All
Browser image
Firefox
All
Browser image
IE
All
Browser image
Opera
All
Browser image
Safari
All

Mobile browser support

Browser image
Chrome
All
Browser image
Firefox
All
Browser image
Opera
All
Browser image
Safari
All