html Tag
The <html>
tag indicates the beginning and end of a web document.
Before declaring the html tag, the webpage should declare DOCTYPE
to let the browser know which version of HTML is used to create the page.
The widely used HTML version on the internet is HTML5
, and by declaring <!DOCTYPE html>
at the top of the HTML document, it signifies that the document adheres to HTML5.
<!DOCTYPE html> <html> <!-- HTML code --> </html>
Note: HTML was first introduced in 1991 and has seen various versions since then. The main versions of HTML are as follows.
HTML (1991)
The original version of HTML was introduced by Tim Berners-Lee, the creator of the World Wide Web.
HTML 2.0 (1995)
The first standardized version of HTML, improved based on feedback from diverse members of the web community.
HTML 3.2 (1997)
Added JavaScript to control the behavior of web pages.
HTML 4.0 (1997)
Introduced stylesheets (CSS) for decorating web pages and improved input forms.
HTML5 (2014, Current Version)
Added various tags such as <canvas>
, <video>
, <audio>
, and modern features like localStorage
which acts as storage within the web browser.
<html>
Tag
The html tag serves as the root (topmost) element of an HTML document and must be placed at both the top and bottom of the document.
Within the <html>
tag, it includes the <head>
tag, which contains information about the web page, and the <body>
tag, which contains the content displayed on the webpage.
Internal Structure of HTML Tag
<!DOCTYPE html> <html> <head> <!-- Include the document's metadata, styles, scripts, etc. here. --> </head> <body> <!-- Insert the content displayed to the user here. --> </body> </html>
The HTML tag can designate the main language of the webpage using the lang attribute.
For example, a webpage primarily in English can be represented as <html>
with the appropriate lang attribute.
<!DOCTYPE html> <!-- lang attribute set to English --> <html lang="en"> <head> <meta charset="UTF-8" /> <title>Webpage Title</title> </head> <body> <h1>Section Title</h1> <p>Section content</p> </body> </html>
An HTML document must always start with the <html>
tag.
Lecture
AI Tutor
Design
Upload
Notes
Favorites
Help