超文本传输协议(HTTP)是用于传输超媒体文档(如 HTML)的应用层协议。它是为 Web 浏览器和 Web 服务器之间的通信而设计的,但也可以用于其他目的。HTTP 遵循经典的客户端-服务器模型,客户端打开一个连接以发出请求,然后等待它所请求的资源。
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Sample HTML Page</title> <style> body { font-family: Arial, sans-serif; background-color: #f4f4f9; color: #333; margin: 0; padding: 0; } header { background-color: #4CAF50; color: white; padding: 10px 0; text-align: center; } nav { display: flex; justify-content: center; background-color: #333; } nav a { color: white; padding: 14px 20px; text-decoration: none; text-align: center; } nav a:hover { background-color: #ddd; color: black; } .container { padding: 20px; } .card { background-color: white; border: 1px solid #ddd; border-radius: 4px; box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); margin: 20px 0; padding: 20px; } footer { background-color: #333; color: white; text-align: center; padding: 10px 0; position: fixed; width: 100%; bottom: 0; } </style> </head> <body> <header> <h1>Welcome to My Sample Page</h1> </header> <nav> <a href="#home">Home</a> <a href="#about">About</a> <a href="#services">Services</a> <a href="#contact">Contact</a> </nav> <div class="container"> <div class="card"> <h2>About Us</h2> <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nullam scelerisque leo nec magna fermentum, a facilisis nulla tincidunt. Integer nec odio nec urna fermentum tincidunt.</p> </div> <div class="card"> <h2>Our Services</h2> <p>We offer a wide range of services to meet your needs. From web development to digital marketing, we have the expertise to help your business grow.</p> </div> <div class="card"> <h2>Contact Us</h2> <p>If you have any questions or would like to get in touch, please contact us at <a href="mailto:info@example.com">info@example.com</a>.</p> </div> </div> <footer> <p>© 2024 My Sample Page. All rights reserved.</p> </footer> </body> </html>