Learn one of the most powerful programming languages in the world and become a rockstar developer.
Don't worry if these examples use tags you have not learned.
You will learn about them in the next chapters.
All HTML documents must start with a document type declaration: <!DOCTYPE html>
.
The HTML document itself begins with <html>
and ends with </html>
.
The visible part of the HTML document is between <body>
and </body>
.
HTML is written in the form of HTML elements consisting of markup tags. These markup tags are the fundamental characteristic of HTML. Every markup tag is composed of a keyword, surrounded by angle brackets, such as <html>
, <head>
, <body>
, <title>
, <p>
, and so on.
HTML tags normally come in pairs like <html>
and </html>
. The first tag in a pair is often called the opening tag (or start tag), and the second tag is called the closing tag (or end tag).
An opening tag and a closing tag are identical, except a slash (/
) after the opening angle bracket of the closing tag, to tell the browser that the command has been completed.
In between the start and end tags you can place appropriate contents. For example, a paragraph, which is represented by the p
element, would be written as:
<!DOCTYPE html> <html> <body> <h1>My First Heading</h1> <p>My first paragraph.</p> </body> </html>
HTML headings are defined with the <h1>
to <h6>
tags.
<h1>
defines the most important heading. <h6>
defines the least important heading:
<h1>This is heading 1</h1> <h2>This is heading 2</h2> <h3>This is heading 3</h3>
HTML paragraphs are defined with the <p>
tag:
<p>This is paragraph 1</p>
HTML links are defined with the <a>
tag:
<a href="https://www.adzetech.com">This is a link</a>
<!DOCTYPE html>
declaration defines this document to be HTML5<html>
element is the root element of an HTML page<head>
element contains meta information about the document<title>
element specifies a title for the document<body>
element contains the visible page content<h1>
element defines a large heading<p>
element defines a paragraph<a>
element defines a hyperlink