HTML Basic Examples

Here are some basic examples of HTML code:

Creating a heading

<h1>This is a level-1 heading</h1>
<h2>This is a level-2 heading</h2>
<h3>This is a level-3 heading</h3>
<h4>This is a level-4 heading</h4>
<h5>This is a level-5 heading</h5>
<h6>This is a level-6 heading</h6>

Creating a paragraph

<p>This is a paragraph of text.</p>

Creating a link

<a href="">This is a link</a>

Creating an image

<img src="image.jpg" alt="image">

Creating an unordered list

  <li>Item 1</li>
  <li>Item 2</li>
  <li>Item 3</li>

Creating an ordered list


Creating a table

    <th>Column 1</th>
    <th>Column 2</th>
    <td>Row 1, Column 1</td>
    <td>Row 1, Column 2</td>
    <td>Row 2, Column 1</td>
    <td>Row 2, Column 2</td>

Creating a form

<form action="process.php" method="post">
  <label for="name">Name:</label><br>
  <input type="text" id="name" name="name"><br>
  <label for="email">Email:</label><br>
  <input type="email" id="email" name="email"><br><br>
  <input type="submit" value="Submit">

These are just a few basic examples of HTML code. You can find more information about HTML elements and how to use them in the HTML documentation.

Leave a Comment