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>
- Example:
<p>
: Paragraph tag for blocks of text.- Example:
<p>This is a paragraph of text on my website.</p>
- Example:
<a>
: Anchor tag used for links.- Example:
<a href="https://www.example.com">Visit Example</a>
- Example:
<img>
: Image tag to display pictures.- Example:
<img src="image.jpg" alt="Description of image">
- Example:
<br>
: creates a break in a line.- Example:
<span>Hi</span><br><span>Goodbye</span>
- Example:
<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>