6.3 Homework/Practice

Create a card layout using the box model. Ensure consistent padding, margins, and border usage

Create a Card Layout Using the Box Model

// Some code
<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Card Layout</title>
  <!-- External CSS file -->
  <link rel="stylesheet" href="styles.css">
</head>
<body>

  <div class="container">
    <!-- Card 1 -->
    <div class="card">
      <h2>Card 1</h2>
      <img src="https://via.placeholder.com/250" alt="Sample Image 1">
      <p>This is a description for Card 1. It includes an image, heading, and text inside a styled box.</p>
    </div>

    <!-- Card 2 -->
    <div class="card">
      <h2>Card 2</h2>
      <img src="https://via.placeholder.com/250" alt="Sample Image 2">
      <p>This is a description for Card 2. It includes an image, heading, and text inside a styled box.</p>
    </div>

    <!-- Card 3 -->
    <div class="card">
      <h2>Card 3</h2>
      <img src="https://via.placeholder.com/250" alt="Sample Image 3">
      <p>This is a description for Card 3. It includes an image, heading, and text inside a styled box.</p>
    </div>
  </div>

</body>
</html>
// Select element

<label for="Seasons">Season:</label>
    <select id="Season">
      <option>All</option>
      <option>Spring</option>
      <option>Summer</option>
      <option>Fall</option>
      <option>Winter</option>
    </select>
    <br />

    <p id="results">???</p>

    <br />

These activities and homework will help students understand the practical application of the CSS box model, margin, padding, borders, and overflow properties. They will learn how to structure and style content boxes and card layouts, which are commonly used in web design.

Last updated