Basic HTML Tags with Results
This document demonstrates basic HTML tags along with the corresponding rendered output.
1. Headings
Headings are defined using <h1> to <h6> tags:
<h1>This is a Heading 1</h1>
This is a Heading 1
<h2>This is a Heading 2</h2>
This is a Heading 2
2. Paragraphs
Paragraphs are created with the <p> tag:
<p>This is a paragraph of text.</p>
This is a paragraph of text.
3. Links
Links are defined using the <a> tag:
<a href="https://learnhtmlcodefree.blogspot.com/2024/10/revision-and-more.html">This is a link</a>
4. Images
Images can be added using the <img> tag:
<img src="https://via.placeholder.com/150" alt="Description of image">
5. Lists
HTML supports ordered (<ol>) and unordered lists (<ul>):
<ul>
<li>Item 1</li>
<li>Item 2</li>
</ul>
- Item 1
- Item 2
<ol>
<li>First Item</li>
<li>Second Item</li>
</ol>
- First Item
- Second Item
6. Strong and Emphasis
To make text bold or italic, use <strong> and <em> tags:
<strong>This text is bold.</strong>
This text is bold.
<em>This text is italicized.</em>
This text is italicized.
7. Blockquotes
Blockquotes are used for quoting text:
<blockquote>
<p>This is a blockquote.</p>
</blockquote>
This is a blockquote.
Example HTML Document
Here’s a small code snippet that combines these tags:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>My First Web Page</title>
</head>
<body>
<h1>Welcome to My First Web Page</h1>
<p>This is a paragraph about my web page.</p>
<a href="https://www.example.com">Visit Example</a>
</body>
</html>
Comments
Post a Comment