网站首页 网站地图
网站首页 > 网络游戏 > index.html

index.html

时间:2026-04-01 11:52:40

Sure! Here's a basic index.html file that you can use as a starting point for a simple web page. This example includes a basic structure with a heading, a paragraph, and a button. You can customize it as needed.

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>My Simple Web Page</title>
    <style>
        body {
            font-family: Arial, sans-serif;
            margin: 0;
            padding: 0;
            background-color: #f4f4f4;
        }
        header {
            background-color: #333;
            color: white;
            padding: 1em 2em;
            text-align: center;
        }
        main {
            padding: 2em;
            max-width: 800px;
            margin: 0 auto;
        }
        .button {
            background-color: #4CAF50;
            color: white;
            padding: 10px 20px;
            border: none;
            cursor: pointer;
            font-size: 16px;
        }
        .button:hover {
            background-color: #45a049;
        }
    </style>
</head>
<body>

    <header>
        <h1>Welcome to My Web Page</h1>
        <p>This is a simple example of an HTML page.</p>
    </header>

    <main>
        <p>This is the main content area of the page.</p>
        <button  onclick="alert('Hello, world!')">Click Me!</button>
    </main>

</body>
</html>

Explanation:

  • <!DOCTYPE html>: Declares the document type and version.
  • <html>: The root element.
  • <head>: Contains metadata and styles.
  • <title>: Sets the title of the web page.
  • <style>: Contains CSS for styling the page.
  • <body>: Contains the content of the page.

To Use:

  1. Copy the code into a file named index.html.
  2. Open the file in a web browser to see the page.

Let me know if you want to add interactivity, images, or more advanced features!