HTML Basic Examples

Below are HTML Basic Examples that help beginners understand how HTML works. Each example is short, clear, and practical.


1. Basic HTML Document Structure

This is the minimum structure of any HTML page.



 


2. HTML Headings

HTML provides six heading levels.

<h1>Main Heading</h1>
<h2>Sub Heading</h2>
<h3>Section Heading</h3>
<h4>Smaller Heading</h4>
<h5>Very Small Heading</h5>
<h6>Smallest Heading</h6>

3. HTML Paragraph

Paragraphs are defined using the <p> tag.

<p>This is a paragraph in HTML.</p>
<p>HTML is easy to learn.</p>

4. HTML Links

Links are created using the <a> tag.

<a href="https://www.google.com">Visit Google</a>

5. HTML Images

Images are added using the <img> tag.

<img src="image.jpg" alt="Sample Image" width="300">

6. HTML Lists

Unordered List

<ul>
<li>HTML</li>
<li>CSS</li>
<li>JavaScript</li>
</ul>

Ordered List

<ol>
<li>Wake up</li>
<li>Study</li>
<li>Practice</li>
</ol>

7. HTML Table

Tables are used to display data.

<table border="1">
<tr>
<th>Name</th>
<th>Age</th>
</tr>
<tr>
<td>Rahul</td>
<td>22</td>
</tr>
</table>

8. HTML Form

Forms are used to collect user input.

<form>
Name: <input type="text"><br><br>
Email: <input type="email"><br><br>
<input type="submit" value="Submit">
</form>

9. HTML Buttons

Buttons trigger actions.

<button>Click Me</button>

10. HTML Comments

Comments are ignored by the browser.

<!-- This is an HTML comment -->
<p>This text is visible</p>

✅ Tip for Beginners

  • HTML is not case-sensitive

  • Always close tags properly

  • Practice by running code in a browser

You may also like...