HTML Basic Examples
Views: 27 | Updated On: | By Sacnilk Team
Here are some basic examples of HTML code and the resulting output:
1. A simple paragraph of text:
HTML:
<p>This is a simple paragraph of text.</p>
Output:
This is a simple paragraph of text.
2. A heading:
HTML:
<h1>This is a heading</h1>
Output:
This is a heading
3. A link:
HTML:
<a href="https://www.example.com">This is a link</a>
Output:
This is a link
4. When you click on this link it will redirect you to https://www.example.com
An image:
HTML:
<img src="image.jpg" alt="An example image">
Output:
5. A bulleted list:
HTML:
<ul> <li>Item 1</li> <li>Item 2</li> <li>Item 3</li> </ul>
Output:
A table:
<table> <tr> <th>Header 1</th> <th>Header 2</th> </tr> <tr> <td>Row 1, Cell 1</td> <td>Row 1, Cell 2</td> </tr> <tr> <td>Row 2, Cell 1</td> <td>Row 2, Cell 2</td> </tr> </table>
Output:
These are just a few basic examples of HTML code and the resulting output. There are many more tags and attributes available in HTML that can be used to create more complex and sophisticated web pages.
Stay tuned.
1. A simple paragraph of text:
HTML:
<p>This is a simple paragraph of text.</p>
Output:
This is a simple paragraph of text.
2. A heading:
HTML:
<h1>This is a heading</h1>
Output:
This is a heading
3. A link:
HTML:
<a href="https://www.example.com">This is a link</a>
Output:
This is a link
4. When you click on this link it will redirect you to https://www.example.com
An image:
HTML:
<img src="image.jpg" alt="An example image">
Output:
5. A bulleted list:
HTML:
<ul> <li>Item 1</li> <li>Item 2</li> <li>Item 3</li> </ul>
Output:
- Item 1
- Item 2
- Item 3
A table:
<table> <tr> <th>Header 1</th> <th>Header 2</th> </tr> <tr> <td>Row 1, Cell 1</td> <td>Row 1, Cell 2</td> </tr> <tr> <td>Row 2, Cell 1</td> <td>Row 2, Cell 2</td> </tr> </table>
Output:
Header 1 | Header 2 |
---|---|
Row 1, Cell 1 | Row 1, Cell 2 |
Row 2, Cell 1 | Row 2, Cell 2 |
These are just a few basic examples of HTML code and the resulting output. There are many more tags and attributes available in HTML that can be used to create more complex and sophisticated web pages.
Stay tuned.
Leave a Comment