Introduction-
What is HTML?
HTML is the standard markup language for creating Web pages.
- HTML stands for Hyper Text Markup Language
- HTML elements are represented by tags
- HTML tags label pieces of content such as “heading”, “paragraph”, “table”, and so on
A Simple HTML Document
Example
<!DOCTYPE html>
<html>
<head>
<title>Page Title</title>
</head>
<body>Content goes here……………
</body>
</html>
- The
<!DOCTYPE html>
declaration defines this document to be HTML5 - The
<html>
element is the root element of an HTML page - The
<head>
element contains meta information about the document - The
<title>
element specifies a title for the document - The
<body>
element contains the visible page content
The <!DOCTYPE> Declaration
The HTML <!DOCTYPE> tag is used for specifying which version of HTML the document is using. This is referred to as the document type declaration (DTD).
The <!DOCTYPE> declaration must be the very first thing in your HTML document, before the <html> tag.
The <!DOCTYPE> declaration for HTML5 is:
<!DOCTYPE html>
HTML Tags
HTML tags contain three main parts: opening tag, content and closing tag. But some HTML tags are unclosed tags. For example: <br>, <hr>, etc.
When a web browser reads an HTML document, browser reads it from top to bottom and left to right. HTML tags are used to create HTML documents and render their properties. Each HTML tags have different properties.
Syntax-
<tagname> content </tagname>
HTML Page Structure
Below is a visualization of an HTML page structure:
<html>
<head>
</head>
<body>
</html>
Web Browsers
The purpose of a web browser (Chrome, IE, Firefox, Safari) is to read HTML documents and display them.
The browser does not display the HTML tags, but uses them to determine how to display the document:
Since the early days of the web, there have been many versions of HTML:
Version | Year |
---|---|
HTML | 1991 |
HTML 2.0 | 1995 |
HTML 3.2 | 1997 |
HTML 4.01 | 1999 |
XHTML | 2000 |
HTML5 | 2014 |