Skip to main content

🙋🏻 Introduction to HTML

HTML stands for Hyper Text Markup Language. It is the standard markup language for creating Web pages. It describes the structure of Web pages using markup.

HTML elements are the building blocks of HTML pages. With HTML constructs, images and other objects, such as interactive forms, may be embedded into the rendered page.

HTML provides a means to create structured documents by denoting structural semantics for text such as headings, paragraphs, lists, links, quotes and other items. HTML elements are delineated by tags, written using angle brackets.

HTML tags are keywords (tag names) surrounded by angle brackets like <html>. HTML tags normally come in pairs like <p> and </p>. The first tag in a pair is the start tag, the second tag is the end tag (they are also called opening tags and closing tags).

The end tag is written like the start tag, but with a forward slash inserted before the tag name. An example of a paragraph element is:

index.html
<html>
<head>
<title>Page Title</title>
</head>
<body>
<h1>This is a Heading</h1>
<p>This is a paragraph.</p>
</body>
</html>
http://127.0.0.1:5500/index.html

This is a Heading

This is a paragraph.

In the example above, the <html> tag is the root element of the HTML document. The <head> element contains meta-information about the document, such as its title. The <title> element specifies a title for the document. The <body> element contains the visible page content. The <h1> element defines a large heading. The <p> element defines a paragraph.

HTML documents are saved in .html or .htm file extension. The file extension is not mandatory, but it is a good practice to use it.

HTML documents are text files that can be created using any text editor. You can use Notepad, Notepad++, Sublime Text, Visual Studio Code, or any other text editor to create HTML documents.

HTML Page Structure

An HTML document consists of the following parts:

<!DOCTYPE html>

<html>

<head>

<title>Page Title</title>

</head>

<body>

<h1>This is a Heading<h1>

<p>This is a paragraph.</p>

<!-- More content goes here -->

</body>

</html>


In this structure:

  • The <!DOCTYPE html> declaration defines the document type and version of HTML.
  • The <html> element is the root element of an HTML page.
  • The <head> element contains meta-information about the document, such as its title.
  • The <title> element specifies a title for the document.
  • The <body> element contains the visible page content.
  • The <h1> element defines a large heading.
  • The <p> element defines a paragraph.

Summary

HTML is the standard markup language for creating Web pages. It describes the structure of Web pages using markup. HTML elements are the building blocks of HTML pages and are delineated by tags, written using angle brackets. HTML tags normally come in pairs like <p> and </p>. The first tag in a pair is the start tag, the second tag is the end tag. HTML documents are saved in .html or .htm file extension and can be created using any text editor. An HTML document consists of the <!DOCTYPE html> declaration, <html>, <head>, <title>, and <body> elements.