An Introduction to HTML: Understanding the Basics of Hyper-Text Markup Language

JavascriptMaster
2 min readFeb 7, 2023

--

You all know about the full form of HTML (Hyper-Text Markup Language) and it is the standard markup language used for creating web pages .

Basic HTML tags and structure

HTML uses a set of tags to describe the content and structure of a web page. Each tag has a specific purpose and is used to format the content within it. The basic structure of an HTML document includes the following elements:

Example of a basic HTML structure:

<!DOCTYPE html>
<html>
<head>
<title>My First HTML Document</title>
</head>
<body>
<h1>Welcome to my website</h1>
<p>This is my first HTML document.</p>
</body>
</html>

DOCTYPE declaration: This is the first line of the HTML document and declares the version of HTML being used.

HTML tag: We are using this tag is used to enclose all other HTML content and serves as the main element of the document.

Head tag: This tag is used to enclose meta information about the document, such as the title, keywords, and descriptions.

Body tag: This tag is used to enclose the main content of the document, such as headings, paragraphs, lists, and images.

Basic HTML tags

Headings: Headings are used to structure the content on a web page and range from h1 to h6.Headings are used to create headings and subheadings.

Example:

<h1>This is a Heading 1</h1>
<h2>This is a Heading 2</h2>

Paragraphs:

Paragraphs are used to create blocks of text on a web page. The paragraph tag is used to enclose the text.

Example:

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

Links:

Links are used to create links between web pages. The anchor tag is used to create a link.
Example:

<a href="https://www.medium.com">Visit medium.com</a>

Images: Images are used to display images on a web page. The image tag is used to embed an image.

Example:

<img src="image.jpg" alt="An example image">

Lists: Lists are used to create lists of items on a web page. There are two types of lists in HTML:

1- unordered lists
2- ordered lists.
Example of an unordered list:

<ul>
<li>Item 1</li>
<li>Item 2</li>
<li>Item 3</li>
</ul>

Example of an ordered list:

<ol>
<li>Item 1</li>
<li>Item 2</li>
<li>Item 3</li>
</ol>

Tables: Tables are used to create tables of data. The table tag is used to create a table, the row tag is used to create a row, and the cell tag is used to create a cell.
Example:

<table>
<tr>
<td>Row 1, Cell 1</td>
<td>Row 1, Cell 2</td>
</tr>
<tr>
<td>Row 2, Cell 1</td>
<td>Row 2, Cell 2</td>
</tr>
</table>

So now we have finished our basics of HTML.

--

--

JavascriptMaster
JavascriptMaster

Written by JavascriptMaster

Hi, I'm a software engineer with a passion for writing about programming languages, particularly Python and JavaScript.

No responses yet