Common HTML Tags and Their Uses

Let’s break down some of the most commonly used HTML tags:

  • <h1> to <h6>: Headings, with <h1> being the most important and <h6> the least.
    • Example: <h1>Welcome to My Webpage</h1>
  • <p>: Paragraph tag for blocks of text.
    • Example: <p>This is a paragraph of text on my website.</p>
  • <a>: Anchor tag used for links.
    • Example: <a href="https://www.example.com">Visit Example</a>
  • <img>: Image tag to display pictures.
    • Example: <img src="image.jpg" alt="Description of image">
  • <br>: creates a break in a line.
    • Example: <span>Hi</span><br><span>Goodbye</span>
  • <ul>, <ol>, <li>: Unordered and ordered lists.
    • Example:
<ul>
  <li>First item</li>
  <li>Second item</li>
</ul>
  • <div> and <span>: Generic containers for grouping content.
    • Example:
<div>
   <span>This is a text inside a span tag.</span>
</div>