Skip to content
TheChatArchiveThe Chat Archive
gpt-4o-mini-2024-07-18· OpenAIAi2 WildChat-4.8M (AI2)

simple html and css code

  1. User

    simple html and css code

  2. Assistant

    Sure! Below is a simple example of an HTML document with some basic CSS styling. This example creates a simple webpage with a header, a paragraph, and a button.

    HTML (index.html)

    <!DOCTYPE html>
    <html lang="en">
    <head>
        <meta charset="UTF-8">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <title>Simple HTML and CSS Example</title>
        <link rel="stylesheet" href="styles.css">
    </head>
    <body>
        <header>
            <h1>Welcome to My Simple Page</h1>
        </header>
        <main>
            <p>This is a simple HTML and CSS example. You can add more content here!</p>
            <button type="button">Click Me!</button>
        </main>
        <footer>
            <p>&copy; 2023 Simple Example</p>
        </footer>
    </body>
    </html>
    

    CSS (styles.css)

    body {
        font-family: Arial, sans-serif;
        margin: 0;
        padding: 0;
        background-color: #f0f0f0;
    }
    
    header {
        background-color: #4CAF50;
        color: white;
        padding: 10px 0;
        text-align: center;
    }
    
    main {
        padding: 20px;
    }
    
    p {
        font-size: 18px;
        line-height: 1.6;
    }
    
    button {
        background-color: #007BFF;
        color: white;
        border: none;
        padding: 10px 15px;
        cursor: pointer;
        font-size: 16px;
    }
    
    button:hover {
        background-color: #0056b3;
    }
    
    footer {
        text-align: center;
        padding: 10px 0;
        background-color: #4CAF50;
        color: white;
        position: absolute;
        bottom: 0;
        width: 100%;
    }
    

    How to use:

    1. Create a new folder on your computer.
    2. Inside the folder, create two files: index.html and styles.css.
    3. Copy the HTML code above into the index.html file.
    4. Copy the CSS code above into the styles.css file.
    5. Open the index.html file in a web browser to see the result.

    This will create a simple styled web page with a header, a paragraph, and a button! You can further customize the styles as you wish.