20 Html Tags And Their Functions

3 min read Jul 02, 2024
20 Html Tags And Their Functions

20 HTML Tags and Their Functions

HTML (HyperText Markup Language) is the foundation of web pages. It's used to structure content, add elements, and define the overall layout of a website. Here are 20 common HTML tags and their functions:

Basic Structure Tags

  1. <html>: Defines the root of the HTML document. Everything else goes inside this tag.
  2. <head>: Contains metadata about the HTML document, such as the title, character set, and links to external stylesheets.
  3. <title>: Specifies the title of the HTML document, which appears in the browser's title bar or tab.
  4. <body>: Contains the visible content of the HTML document, including text, images, and other elements.

Text Formatting Tags

  1. <h1> to <h6>: Defines heading levels, with <h1> being the largest and most important heading and <h6> the smallest.
  2. <p>: Defines a paragraph of text.
  3. <br>: Inserts a line break.
  4. <strong>: Makes text bold.
  5. <em>: Makes text italic.
  6. <pre>: Preserves whitespace and formatting, useful for displaying code or text blocks.

Structural Tags

  1. <div>: A generic container element used to group other elements together and apply styles.
  2. <span>: An inline container element used to group inline elements together and apply styles.
  3. <ul>: Defines an unordered list.
  4. <ol>: Defines an ordered list.
  5. <li>: Defines a list item.
  6. <table>: Defines a table.
  7. <tr>: Defines a row in a table.
  8. <td>: Defines a cell in a table.

Image and Multimedia Tags

  1. <img>: Inserts an image into the HTML document.
  2. <video>: Embeds a video player into the HTML document.

Other Important Tags

  1. <a>: Defines a hyperlink.
  2. <form>: Defines an HTML form for user input.
  3. <input>: Creates an input field for user input.
  4. <button>: Creates a button element.
  5. <script>: Includes JavaScript code in the HTML document.

This is just a basic introduction to some common HTML tags. There are many more tags available, each with specific functions and uses. For a comprehensive understanding of HTML, it's essential to refer to the official W3C HTML documentation.

Related Post


Featured Posts