Skip to content
TheChatArchiveThe Chat Archive
gpt-3.5-turbo-0613· openaiHugging Face Suzhen/CodeChat

模仿https://www.lihuang.top生成一个网页,包含html,css,js

  1. User
  2. Assistant

    以下是一个模仿https://www.lihuang.top生成的网页的示例代码:

    <!DOCTYPE html>
    <html lang="en">
    
    <head>
      <meta charset="UTF-8">
      <meta name="viewport" content="width=device-width, initial-scale=1.0">
      <title>模仿 lihuang.top</title>
      <link rel="stylesheet" href="style.css">
    </head>
    
    <body>
      <header>
        <nav>
          <div class="logo">
            <a href="#"><img src="logo.png" alt="Logo"></a>
          </div>
          <ul class="nav-links">
            <li><a href="#">Home</a></li>
            <li><a href="#">About</a></li>
            <li><a href="#">Services</a></li>
            <li><a href="#">Portfolio</a></li>
            <li><a href="#">Contact</a></li>
          </ul>
        </nav>
        <div class="hero">
          <div class="hero-text">
            <h1>Welcome to my website</h1>
            <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla fringilla tortor sed ullamcorper vehicula.
              Fusce id luctus ex. Donec ac lectus ante.</p>
            <a href="#" class="cta-btn">Learn More</a>
          </div>
        </div>
      </header>
    
      <section class="about">
        <div class="container">
          <h2>About Me</h2>
          <div class="about-text">
            <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla fringilla tortor sed ullamcorper vehicula. Fusce
              id luctus ex. Donec ac lectus ante. Nunc maximus justo nec nisi fringilla, a vestibulum eros fermentum. Fusce
              in fermentum erat. Sed eleifend, ipsum eget consequat ornare, magna ipsum dapibus odio, vitae efficitur sem
              nunc a nunc.</p>
          </div>
        </div>
      </section>
    
      <section class="services">
        <div class="container">
          <h2>My Services</h2>
          <div class="service-container">
            <div class="service">
              <img src="service1.png" alt="Service 1">
              <h3>Web Design</h3>
              <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla fringilla tortor sed ullamcorper vehicula.
                Fusce id luctus ex.</p>
            </div>
            <div class="service">
              <img src="service2.png" alt="Service 2">
              <h3>Web Development</h3>
              <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla fringilla tortor sed ullamcorper vehicula.
                Fusce id luctus ex.</p>
            </div>
            <div class="service">
              <img src="service3.png" alt="Service 3">
              <h3>Graphic Design</h3>
              <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla fringilla tortor sed ullamcorper vehicula.
                Fusce id luctus ex.</p>
            </div>
          </div>
        </div>
      </section>
    
      <footer>
        <div class="container">
          <p>&copy; 2021 Your Name. All rights reserved.</p>
        </div>
      </footer>
    
      <script src="script.js"></script>
    </body>
    
    </html>
    

    接下来是"style.css"文件的代码:

    /* Reset Styles */
    * {
      margin: 0;
      padding: 0;
      box-sizing: border-box;
    }
    
    body {
      font-family: Arial, sans-serif;
      line-height: 1.6;
    }
    
    /* Header Styles */
    header {
      background-color: #333;
      color: #fff;
      padding: 20px;
    }
    
    nav {
      display: flex;
      align-items: center;
      justify-content: space-between;
    }
    
    .nav-links li {
      display: inline-block;
      margin-left: 20px;
    }
    
    .nav-links a {
      text-decoration: none;
      color: #fff;
    }
    
    .hero {
      background-image: url('hero-image.jpg');
      height: 400px;
      background-position: center;
      background-repeat: no-repeat;
      background-size: cover;
      display: flex;
      align-items: center;
      justify-content: center;
    }
    
    .hero-text {
      text-align: center;
    }
    
    h1 {
      font-size: 36px;
      margin-bottom: 20px;
    }
    
    .cta-btn {
      display: inline-block;
      padding: 10px 20px;
      background-color: #fff;
      color: #333;
      text-decoration: none;
      margin-top: 20px;
    }
    
    /* About Section Styles */
    .about {
      background-color: #f4f4f4;
      padding: 50px 0;
      text-align: center;
    }
    
    .about h2 {
      margin-bottom: 20px;
    }
    
    /* Services Section Styles */
    .services {
      padding: 50px 0;
      text-align: center;
    }
    
    .services h2 {
      margin-bottom: 20px;
    }
    
    .service-container {
      display: flex;
      justify-content: space-between;
    }
    
    .service {
      width: 30%;
    }
    
    .service img {
      width: 100px;
      height: 100px;
      margin-bottom: 20px;
    }
    
    /* Footer Styles */
    footer {
      background-color: #333;
      color: #fff;
      padding: 20px;
      text-align: center;
    }
    

    最后是"script.js"文件的代码:

    // JavaScript代码在此处
    console.log("Hello, World!");
    

    请注意替换示例代码中的图片地址和文件名,并根据需要进行任何其他样式和内容的修改。

Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.