Skip to content
The Chat Archive
gpt-3.5-turbo-0613· OpenAI WildChat-4.8M (AI2)

Write a beautiful website using CSS on which there will be 2 products in the upper left…

  1. User

    Write a beautiful website using CSS on which there will be 2 products in the upper left part of the page

  2. Assistant

    Sure, here's an example of a beautiful website using CSS with two products displayed in the upper left part of the page:

    HTML code:

    <!DOCTYPE html>
    <html>
    <head>
      <title>Beautiful Website</title>
      <link rel="stylesheet" type="text/css" href="style.css">
    </head>
    <body>
      <header>
        <h1>Welcome to our Store</h1>
      </header>
      
      <main>
        <section class="products">
          <div class="product">
            <img src="product1.jpg" alt="Product 1">
            <h2>Product 1</h2>
            <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Fusce ac aliquam neque. Integer in tortor nec nisi bibendum cursus.</p>
            <a href="#" class="btn">Buy Now</a>
          </div>
          <div class="product">
            <img src="product2.jpg" alt="Product 2">
            <h2>Product 2</h2>
            <p>Fusce dapibus faucibus tellus, id varius orci viverra ut. Nunc pharetra, urna vel placerat dignissim, sapien lacus consectetur neque.</p>
            <a href="#" class="btn">Buy Now</a>
          </div>
        </section>
      </main>
    </body>
    </html>
    

    CSS code (style.css):

    body {
      margin: 0;
      padding: 0;
      font-family: Arial, sans-serif;
      background-color: #f5f5f5;
    }
    
    header {
      background-color: #333;
      color: #fff;
      padding: 20px;
      text-align: center;
    }
    
    h1 {
      margin: 0;
      font-size: 24px;
    }
    
    main {
      max-width: 1200px;
      margin: 40px auto;
      padding: 0 20px;
    }
    
    .products {
      display: flex;
      flex-wrap: wrap;
      justify-content: space-between;
    }
    
    .product {
      width: 45%;
      background-color: #fff;
      padding: 20px;
      margin-bottom: 20px;
      box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    }
    
    .product img {
      max-width: 100%;
      height: auto;
    }
    
    .product h2 {
      margin: 10px 0;
      font-size: 20px;
    }
    
    .product p {
      color: #666;
      margin-bottom: 10px;
    }
    
    .product .btn {
      display: inline-block;
      padding: 10px 20px;
      background-color: #333;
      color: #fff;
      text-decoration: none;
      transition: background-color 0.3s ease;
    }
    
    .product .btn:hover {
      background-color: #555;
    }
    

    This website has a responsive layout, with a header displaying the store name, and the main content area divided into sections. The products are displayed in a flex container with the products class, each contained in a product class div. Each product has an image, title, description, and a "Buy Now" button. The CSS styles the layout, aspect, and hover effect of the products.

    Make sure to replace the product1.jpg and product2.jpg files with the actual images you want to display.