HTML

1. Document Structure

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Your Title</title>
</head>
<body>
    <!-- Your content goes here -->
</body>
</html>

2. Text Formatting

<!-- Headings -->
<h1>This is Heading 1</h1>
<h2>This is Heading 2</h2>
<!-- Paragraph -->
<p>This is a paragraph.</p>
<!-- Bold & Italic -->
<strong>Bold Text</strong>
<em>Italic Text</em>
<!-- Line Break -->
<p>First line<br>Second line</p>

3. Links

<!-- Anchor Tag -->
<a href="https://example.com" target="_blank" title="Visit Example">Visit Example</a>

4. Images

<!-- Image Tag -->
<img src="image.jpg" alt="Description">

5. Lists

<!-- Unordered List -->
<ul>
    <li>Item 1</li>
    <li>Item 2</li>
</ul>
<!-- Ordered List -->
<ol>
    <li>Item 1</li>
    <li>Item 2</li>
</ol>

6. Forms

<form action="/submit" method="post">
    <!-- Text Input -->
    <label for="username">Username:</label>
    <input type="text" id="username" name="username">
    <!-- Password Input -->
    <label for="password">Password:</label>
    <input type="password" id="password" name="password">
    <!-- Submit Button -->
    <input type="submit" value="Submit">
</form>

7. Tables

<!-- Table -->
<table border="1">
    <tr>
        <th>Header 1</th>
        <th>Header 2</th>
    </tr>
    <tr>
        <td>Data 1</td>
        <td>Data 2</td>
    </tr>
</table>

8. Divisions & Spans

<!-- Division -->
<div>
    <!-- Your content goes here -->
</div>
<!-- Span -->
<p>This is a <span style="color: blue;">blue</span> word.</p>

9. Comments

<!-- This is a comment -->

10. Scripting

<!-- Script Tag -->
<script>
    alert('Hello, World!');
</script>

Last updated