Learning coding means GreatToCode Be more than a Coder ! Greattocode , Join GreatToCode Community,1000+ Students Trusted On Us .If You want to learn coding, Then GreatToCode Help You.No matter what It Takes !


CODE YOUR WAY TO A MORE FULFILLING And HIGHER PAYING CAREER IN TECH, START CODING FOR FREE Camp With GreatToCode - Join the Thousands learning to code with GreatToCode
Interactive online coding classes for at-home learning with GreatToCode . Try ₹Free Per Month Coding Classes With The Top Teachers . Top 20 HTML Examples for Beginners

Top 20 HTML Examples for Beginners

Become More Then A coder | Learn & Start Coding Now.

Mastering the Basics: Top 20 HTML Examples for Beginners


HTML (HyperText Markup Language) is the foundation of web development, and it's where every aspiring web developer should start. In this blog post, we've compiled a list of the top 20 basic HTML examples to help you kickstart your web development journey. Let's dive right in!

### 1. Creating a Simple HTML Page


```html
<!DOCTYPE html>
<html>
<head>
    <title>My First HTML Page</title>
</head>
<body>
    <h1>Hello, World!</h1>
    <p>This is a basic HTML example.</p>
</body>
</html>
```

This is your quintessential "Hello, World!" HTML example. It showcases the basic structure of an HTML page with a title, header, and a paragraph.

### 2. Adding Comments


```html
<!-- This is a comment -->
```

Comments are crucial for code documentation. They won't be visible on the web page and are used to provide explanations.

### 3. Headings


```html
<h1>Heading 1</h1>
<h2>Heading 2</h2>
<h3>Heading 3</h3>
<h4>Heading 4</h4>
<h5>Heading 5</h5>
<h6>Heading 6</h6>
```

HTML offers six levels of headings, with `<h1>` being the most prominent and `<h6>` the least.

### 4. Paragraphs


```html
<p>This is a paragraph.</p>
```

Use `<p>` to create paragraphs and structure your content.

### 5. Line Breaks


```html
<p>This is a line of text.<br> This is on a new line.</p>
```

`<br>` allows you to insert line breaks within a paragraph.

### 6. Lists (Ordered and Unordered)


```html
<ul>
    <li>Item 1</li>
    <li>Item 2</li>
</ul>

<ol>
    <li>First</li>
    <li>Second</li>
</ol>
```

Use `<ul>` for unordered lists (bullets) and `<ol>` for ordered lists (numbers).

### 7. Links


```html
<a href="https://www.example.com">Visit Example</a>
```

Create hyperlinks using the `<a>` tag with the `href` attribute.

### 8. Images


```html
<img src="image.jpg" alt="Description">
```

Use the `<img>` tag to display images with the `src` (source) and `alt` (alternative text) attributes.

### 9. Basic Text Formatting


```html
<strong>Bold text</strong>
<em>Italic text</em>
<del>Deleted text</del>
```

Enhance text using `<strong>`, `<em>`, and `<del>` for bold, italic, and deleted text, respectively.

### 10. Horizontal Lines


```html
<hr>
```

`<hr>` creates horizontal lines, useful for separating content.

### 11. Links to Email


```html
<a href="mailto:your@email.com">Send Email</a>
```

Hyperlink to email addresses using `mailto:`.

### 12. Creating Tables


```html
<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>
</table>
```

Tables are formed with `<table>`, `<tr>` (table rows), `<th>` (table headers), and `<td>` (table cells).

### 13. Comments


```html
<!-- This is a comment -->
```

Comments in HTML are enclosed in `<!--` and `-->` and are not visible on the web page.

### 14. Forms


```html
<form action="/submit" method="post">
    <input type="text" name="name" placeholder="Your Name">
    <input type="submit" value="Submit">
</form>
```

HTML forms are used for user input, with elements like `<input>`, `<textarea>`, and `<button>`.

### 15. Line Comments


```html
<p><!-- This is a line comment --></p>
```

Line comments are used within HTML elements.

### 16. Special Characters


```html
&copy; &lt; &gt; &amp;
```

Use HTML entities to display special characters.

### 17. Blockquotes


```html
<blockquote>
    This is a blockquote.
</blockquote>
```

`<blockquote>` is used for long quotes.

### 18. Superscript and Subscript


```html
X<sup>2</sup> H<sub>2</sub>O
```

`<sup>` for superscript and `<sub>` for subscript.

### 19. Lists with Links


```html
<ul>
    <li><a href="page1.html">Page 1</a></li>
    <li><a href="page2.html">Page 2</a></li>
</ul>
```

Lists can contain links as well.

### 20. Nested Elements


```html
<div>
    <h2>This is a heading</h2>
    <p>This is a paragraph within a div.</p>
</div>
```

Elements can be nested within each other.

These 20 basic HTML examples are your foundation for web development. As you master these fundamentals, you'll be well on your way to creating fantastic web pages and applications. Remember, practice makes perfect, so don't hesitate to experiment and build upon these examples to hone your HTML skills. Happy coding!

Post a Comment

0 Comments

•Give The opportunity to your child with GreatToCode Kid's • Online Coding Classes for Your Kid • Introduce Your kid To the world's of coding
•Fuel You Career with our 100+ Hiring Partners, Advance Your Career in Tech with GreatToCode. •Join The Largest Tech and coding Community and Fast Forward Your career with GreatToCode. •10000+ Learner's+ 90 % placement Guarantee. • Learning Coding is Better with the GreatToCode community .
•Greattocode Kid's •GreatToCode Career •GreatToCode Interview •GreatToCode Professional •GreatToCode for schools •GreatToCode For colleges •GreatToCods For Businesses.
Are you ready to join the millions of people learning to code? GreatToCode Pass is your one-stop-shop to get access to 1000+ courses, top-notch support, and successful job placement. What are you waiting for? Sign up now and get your future in motion with GreatToCode Pass.