Web Development Course:
html Tag: Main Tips
<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:
<!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
The xmlns Attribute
You can include an
xmlns attribute to set an XML namespace for HTML documents parsed with an XML parser:
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.
Mobile browser support
HTML5 Tags List: Get to Know the Most Useful Elements
Find HTML5 tags explained and illustrated with beginner-friendly HTML5 examples. Grasp the difference between HTML5 tags & elements and learn to use both!
HTML Text Formatting: Explanation, Tags and Examples
Master HTML text formatting quickly! How to bold text, italicize HTML? Find out everything there is about HTML text formatting usage form our examples.