Welcome to HTML Basic Examples!
Are you new to HTML and looking for some basic examples to get started? You’ve come to the right place! In this guide, we’ll walk you through some simple HTML examples that will help you understand the fundamentals of web development.
Example 1: Creating Headings
Headings are an essential part of any web page as they provide structure and hierarchy to your content. Here’s an example of how to create different headings:
<h1>This is a Heading 1</h1> <h2>This is a Heading 2</h2> <h3>This is a Heading 3</h3> <h4>This is a Heading 4</h4> <h5>This is a Heading 5</h5> <h6>This is a Heading 6</h6>
Example 2: Adding Paragraphs
Paragraphs are used to organize and present text content on a webpage. Here’s an example of how to add paragraphs:
<p>This is a paragraph. It can contain multiple sentences and provide context to your content.</p> <p>This is another paragraph. You can add as many paragraphs as you need.</p>
Example 3: Inserting Images
Images can make your web page visually appealing and enhance the user experience. Here’s an example of how to insert an image:
<img src="image.jpg" alt="Description of the image">
Example 4: Creating Lists
Lists are used to present information in an organized manner. There are two types of lists: ordered and unordered. Here’s an example of how to create both types:
<ul> <li>Item 1</li> <li>Item 2</li> <li>Item 3</li> </ul> <ol> <li>Item 1</li> <li>Item 2</li> <li>Item 3</li> </ol>
Example 5: Creating Links
Links allow users to navigate between different web pages. Here’s an example of how to create a link:
<a href="https://www.example.com">Click here</a> to visit our website.
Example 6: Adding Tables
Tables are used to display structured data on a webpage. Here’s an example of how to create a simple table:
<table> <tr> <th>Header 1</th> <th>Header 2</th> </tr> <tr> <td>Data 1</td> <td>Data 2</td> </tr> </table>
Example 7: Styling Text
You can enhance the appearance of your text using HTML tags. Here’s an example of how to style text:
<p>This is <strong>bold</strong> text.</p> <p>This is <em>italicized</em> text.</p> <p>This is <u>underlined</u> text.</p>
Example 8: Adding Comments
Comments are used to add notes or explanations to your HTML code. Here’s an example of how to add comments:
<!-- This is a comment. It won't be displayed on the webpage. -->
These are just a few basic examples to help you get started with HTML. As you continue your journey in web development, you’ll discover many more exciting features and elements that HTML has to offer. Remember to practice and experiment to gain a better understanding of how HTML works.
Happy coding!