html网页代码

Sure, here's a basic HTML template for a webpage:

html
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>My Webpage</title> <style> /* Your CSS styles go here */ body { font-family: Arial, sans-serif; margin: 0; padding: 0; background-color: #f0f0f0; } header { background-color: #333; color: #fff; padding: 10px; text-align: center; } nav { background-color: #666; color: #fff; padding: 10px; text-align: center; } section { padding: 20px; } footer { background-color: #333; color: #fff; padding: 10px; text-align: center; position: fixed; bottom: 0; width: 100%; } </style> </head> <body> <header> <h1>Welcome to My Webpage</h1> </header> <nav> <a href="#">Home</a> | <a href="#">About</a> | <a href="#">Contact</a> </nav> <section> <h2>About Us</h2> <p>This is a paragraph about our website.</p> </section> <footer> <p>&copy; 2024 My Webpage. All rights reserved.</p> </footer> </body> </html>

This HTML code defines a simple webpage with a header, navigation bar, section, and footer. Feel free to modify it according to your needs!

Certainly! Here's a continuation of the HTML code, adding more elements and structure to the webpage:

html
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>My Webpage</title> <style> /* Your CSS styles go here */ body { font-family: Arial, sans-serif; margin: 0; padding: 0; background-color: #f0f0f0; } header { background-color: #333; color: #fff; padding: 10px; text-align: center; } nav { background-color: #666; color: #fff; padding: 10px; text-align: center; } section { padding: 20px; margin-bottom: 20px; background-color: #fff; } footer { background-color: #333; color: #fff; padding: 10px; text-align: center; position: fixed; bottom: 0; width: 100%; } </style> </head> <body> <header> <h1>Welcome to My Webpage</h1> </header> <nav> <a href="#">Home</a> | <a href="#">About</a> | <a href="#">Contact</a> </nav> <section> <h2>About Us</h2> <p>This is a paragraph about our website.</p> <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla commodo lacinia mauris, ut pharetra justo commodo in.</p> </section> <section> <h2>Contact Us</h2> <p>For inquiries, please contact us at:</p> <address> Email: <a href="mailto:info@example.com">info@example.com</a><br> Phone: 123-456-7890 </address> </section> <footer> <p>&copy; 2024 My Webpage. All rights reserved.</p> </footer> </body> </html>

This extended HTML code includes more sections like "About Us" and "Contact Us", with additional content. Feel free to customize it further to suit your needs!