Skip to content

HTML Basic Tags

HTML, or HyperText Markup Language, is the standard markup language used to create web pages. It consists of a set of elements, or tags, that define the structure and content of a document. Here’s a detailed discussion of some basic HTML tags:

1. <html>: The <html> tag is the root element of an HTML document, encapsulating the entire content of the page. It serves as the container for all other HTML elements and provides the overall structure of the document.

Example:

<!DOCTYPE html>

<html lang=”en”>

 <!– Document content goes here –>

 </html>

2. <head>: The <head> tag contains metadata about the document, including title, character encoding, stylesheets, scripts, and other essential information that is not directly visible to users but is used by browsers and search engines.

Example:

<head>

<meta charset=”UTF-8″>

 <title>Document Title</title>

<link rel=”stylesheet” href=”styles.css”> <script src=”script.js”>

</script>

</head>

3. <title>: The <title> tag defines the title of the document, which appears in the browser’s title bar or tab. It is a required element within the <head> section and provides a brief description of the page’s content.

Example:

<title>Document Title</title>

4. <body>: The <body> tag contains the main content of the document, including text, images, links, forms, and other elements visible to users. It defines the visible portion of the web page displayed within the browser window.

Example:

<body>

<h1>Main Heading</h1>

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

 <img src=”image.jpg” alt=”Image”>

 <!– Other content goes here –>

 </body>

5. <h1> to <h6>: The heading tags (<h1> to <h6>) define headings of varying levels of importance and hierarchy. <h1> is the highest level heading, typically used for the main title of the page, while <h6> is the lowest level heading.

Example:

<h1>Main Heading</h1>

 <h2>Subheading</h2>

<h3>Sub-subheading</h3>

6. <p>: The <p> tag defines paragraphs of text within the document. It is used to group and structure blocks of text into coherent paragraphs, providing readability and organization to the content.

Example:

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

These are just a few examples of basic HTML tags used to create the structure and content of web pages. HTML provides a wide range of elements for formatting text, adding images, creating links, and more, allowing developers to create rich and interactive web experiences.