Setting Up Your First HTML Page

To create a functioning webpage or website, you need to follow a basic structure and include key elements. Below is a breakdown of what you need to get started:

Key Elements of an HTML Page

1. Doctype Declaration

The `<!DOCTYPE html>` declaration specifies that the document is an HTML5 document:

<!DOCTYPE html>

2. Basic HTML Structure

Every HTML page needs the following structure:

<html>
    <head>
        <title>Page Title</title>
    </head>
    <body>
        Page content goes here.
    </body>
</html>

3. The Head Section

The `<head>` section contains metadata and links to resources like stylesheets:

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link rel="stylesheet" href="styles.css">
    <title>Website Title</title>
</head>

4. The Body Section

The `<body>` section contains the visible content of the webpage:

<body>
    <header>
        <h1>Welcome to My Website</h1>
    </header>
    <main>
        <p>This is the main content area.</p>
    </main>
    <footer>
        <p>Footer content goes here.</p>
    </footer>
</body>

Best Practices for Building a Website