"Mastering HTML Tags: Structuring Your Web Content"

·

2 min read

List of some common HTML tags and their basic syntax:

  1. <!DOCTYPE>

    Declaration:

    • Syntax: <!DOCTYPE html>

    • Description: Declares the document type and version of HTML being used. In modern HTML, you typically use <!DOCTYPE html> to indicate HTML5.

  2. <html> Element:

    • Syntax: <html> ... </html>

    • Description: The root element that contains all other HTML elements.

  3. <head> Element:

    • Syntax: <head> ... </head>

    • Description: Contains metadata about the document, such as the page title, character encoding, and links to external resources.

  4. <title> Element:

    • Syntax: <title>Page Title</title>

    • Description: Sets the title of the web page, which appears in the browser's title bar or tab.

  5. <body> Element:

    • Syntax: <body> ... </body>

    • Description: Contains the visible content of the web page, including text, images, links, and more.

  6. Headings (<h1> to <h6>):

    • Syntax: <h1>Heading 1</h1> to <h6>Heading 6</h6>

    • Description: Defines headings of different levels, with <h1> being the highest level of importance and <h6> the lowest.

  7. <p> Element:

    • Syntax: <p>This is a paragraph of text.</p>

    • Description: Defines a paragraph of text.

  8. <hr> Element (Horizontal Rule):

    • Syntax: <hr> or <hr/>

    • Description: Creates a horizontal line on the page to separate content.

  9. <br> Element (Line Break):

    • Syntax: <br> or <br/>

    • Description: Forces text onto the next line without creating a new paragraph.

  10. <b> Element (Bold Text):

  • Syntax: <b>This text is bold.</b>

  • Description: Defines text as bold.

  1. <i> Element (Italic Text):
  • Syntax: <i>This text is italic.</i>

  • Description: Defines text as italic.

  1. <sub> Element (Subscript):
  • Syntax: <sub>Subscript</sub>

  • Description: Defines text as a subscript.

  1. <sup> Element (Superscript):
  • Syntax: <sup>Superscript</sup>

  • Description: Defines text as a superscript.

Did you find this article valuable?

Support Gokil P by becoming a sponsor. Any amount is appreciated!