class="post-template-default single single-post postid-673 single-format-standard wp-custom-logo wp-embed-responsive right-sidebar nav-float-right separate-containers header-aligned-left dropdown-hover" itemtype="https://schema.org/Blog" itemscope>

How to create a document in HTML?

नमस्कार दोस्तों! इस लेख में हम जानेंगे How to create a document in HTML? वो भी code भी आपको दिया जायेगा।

How to create a document in HTML?

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>My First HTML Document</title>
</head>
<body>
    <h1>Welcome to My First HTML Page</h1>
    <p>This is a paragraph of text in my HTML document.</p>
</body>
</html>

Create an HTML document which uses aside element?

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Article with Sidebar</title>
    <style>
        body {
            font-family: Arial, sans-serif;
            margin: 20px;
            display: flex;
        }
        main {
            flex: 2;
            margin-right: 20px;
        }
        aside {
            flex: 1;
            background-color: #f4f4f4;
            padding: 20px;
            border-left: 2px solid #ccc;
        }
    </style>
</head>
<body>
    <main>
        <h1>Main Article</h1>
        <p>This is the main content of the article. It contains the primary information that the user is expected to read.</p>
        <p>HTML5 introduced the <code>&lt;aside&gt;</code> element to create a section of content that is related to the main content but can stand apart from it.</p>
    </main>

    <aside>
        <h2>Related Information</h2>
        <p>This sidebar contains related information or links. It could be additional resources, advertisements, or even a summary of the main content.</p>
        <ul>
            <li><a href="#">Related Link 1</a></li>
            <li><a href="#">Related Link 2</a></li>
            <li><a href="#">Related Link 3</a></li>
        </ul>
    </aside>
</body>
</html>

Refrence: www.w3resource.com

By- Amit Thinks: How to create a document in HTML?

1 thought on “How to create a document in HTML?”

Leave a comment