HTML Assignment practice

 

HTML Code:

<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>Product Landing Page</title>
  <link rel="stylesheet" href="styles.css">
</head>
<body>
  <header>
    <nav>
      <ul>
        <li><a href="#">Home</a></li>
        <li><a href="#">Products</a></li>
        <li><a href="#">About</a></li>
        <li><a href="#">Contact</a></li>
      </ul>
    </nav>
  </header>

  <section class="hero">
    <div class="hero-content">
      <h1>Introducing the Ultimate Product</h1>
      <p>The best solution for your everyday needs. Get yours today and experience the future!</p>
      <a href="#purchase" class="cta-button">Buy Now</a>
    </div>
    <div class="hero-image">
      <img src="https://via.placeholder.com/400" alt="Product Image">
    </div>
  </section>

  <section class="features">
    <h2>Product Features</h2>
    <div class="feature">
      <h3>Feature 1</h3>
      <p>Innovative design for ultimate comfort.</p>
    </div>
    <div class="feature">
      <h3>Feature 2</h3>
      <p>Long-lasting performance and quality.</p>
    </div>
    <div class="feature">
      <h3>Feature 3</h3>
      <p>Affordable price with amazing value.</p>
    </div>
  </section>

  <footer>
    <p>&copy; 2025 Ultimate Product Inc. All rights reserved.</p>
  </footer>
</body>
</html>

CSS Code (styles.css):

/* Reset some default styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
  }
 
  body {
    font-family: Arial, sans-serif;
    background-color: #f8f8f8;
    color: #333;
  }
 
  header {
    background-color: #333;
    color: #fff;
    padding: 10px 0;
  }
 
  nav ul {
    display: flex;
    justify-content: center;
    list-style-type: none;
  }
 
  nav li {
    margin: 0 20px;
  }
 
  nav a {
    color: #fff;
    text-decoration: none;
    font-weight: bold;
  }
 
  .hero {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: #008cba;
    color: white;
    padding: 60px 20px;
  }
 
  .hero-content {
    max-width: 500px;
  }
 
  .hero h1 {
    font-size: 3em;
    margin-bottom: 20px;
  }
 
  .hero p {
    font-size: 1.2em;
    margin-bottom: 30px;
  }
 
  .cta-button {
    background-color: #ff5733;
    color: white;
    padding: 15px 30px;
    font-size: 1.2em;
    text-decoration: none;
    border-radius: 5px;
    transition: background-color 0.3s;
  }
 
  .cta-button:hover {
    background-color: #c04029;
  }
 
  .hero-image img {
    width: 400px;
    height: auto;
  }
 
  .features {
    background-color: white;
    padding: 50px 20px;
    text-align: center;
  }
 
  .features h2 {
    font-size: 2.5em;
    margin-bottom: 40px;
  }
 
  .feature {
    margin-bottom: 30px;
  }
 
  .feature h3 {
    font-size: 1.8em;
    margin-bottom: 15px;
  }
 
  footer {
    background-color: #333;
    color: #fff;
    padding: 20px;
    text-align: center;
  }

Explanation:

  • HTML Structure:

    • The page has a header with a navigation menu containing links to different sections.
    • A hero section with a title, description, call-to-action button, and an image representing the product.
    • A features section that showcases some key product features.
    • A footer that contains a copyright notice.
  • CSS Styling:

    • Basic styles like font-family, background colors, and padding.
    • Flexbox is used for layout in the .hero section to align the content and image side by side.
    • Hover effect for the call-to-action button.
    • Styling for the feature section and overall spacing.

Result:

  • This will create a simple, responsive landing page with an attention-grabbing section for your product and a clean design.
  • The design can be made responsive with media queries, but for simplicity, this basic layout should work well on larger screens.

If you want to try running this, you can copy the HTML and CSS into separate files (index.html and styles.css), then open index.html in a browser to see the result. Let me know if you'd like any changes or additional features!

Comments

Popular posts from this blog

Introduction to Computer

History of Computer

Computer Generation