Build an Event Flyer Page - Build an Event Flyer Page

Tell us what’s happening:

It asks me for these but I already entered them, what I don’t see
11. Your body element should have a top and bottom margin of 0.
12. Your body element should have a left and right margin of auto.
13. Your body element should set its width using vw.
14. Your body should use calc to set its min-height to 100vh - 100px.
17. The width of your section elements should be set using a percent value.

Your code so far

<!-- file: index.html -->
<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Build an Event Flyer Page</title>
  <link rel="stylesheet" href="styles.css">
</head>

<body class="body">

  <header class="header">
    <img class="img" src="https://cdn.freecodecamp.org/curriculum/labs/event.jpg" alt="event image bandiers">
    <h1>Events in Italy</h1>
    <p>Various important events throughout Italy</p>
  </header>

  <main class="main">
    <hr>

    <section class="nord">
      <h2>Nord Italy</h2>
      <p><strong>Vinitaly </strong> - <br>is located in Verona at the Fieracavalli.</p>
    </section>

    <section class="center">
      <h2>Center Italy</h2>
      <p><strong>Primi d'Italia</strong> - <br> which is located in Umbria and has various food stands</p>
    </section>
    
    <section class="sud">
      <h2>Sud Italy</h2>
      <p><strong>Bronte Pistachio Festival</strong> - <br> held in Bronte (Catania)</p>  
    </section>
  </main>
</body>
<footer class="footer">
  <hr>
    <p> 2025, Events in Italy</p>
  </footer>

</html>
/* file: styles.css */
.body{
  box-sizing: border-box; 
  font-family: sans-serif; 
  margin: 0 auto; 
  min-height: calc(100vh - 100px);
  padding: 50px; 
  text-align: center;
  width: 100vw; 
}
.header{
  margin-bottom: 20px;
  text-align: center;
}
.img {
    display: block;
    height: auto;
    margin: 0 auto;
    max-width: 100%;
}

hr {
    border: 1px solid black;
    box-sizing: border-box;
    margin: 30px auto;
    width: 70%;
}

.main{
  display: inline;
}

.nord{
  float:left; 
  display:inline; 
  width:30%; 
  height:150px;
  text-align:center;
  padding: 10px;
}

.center{
  float:left; 
  width:30%; 
  height:150px;
  text-align:center;
  padding: 10px;
  display: flex, inline-block;
}

.sud{
  float:left; 
  width:30%; 
  height:150px;
  text-align:center;
  padding: 10px;
  display: flex, inline-block;
}

.footer{
  display:block; 
  width:600px; 
  height:150px;
  text-align:center;
  padding: 10px;
}

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/140.0.0.0 Safari/537.36

Challenge Information:

Build an Event Flyer Page - Build an Event Flyer Page

try using type selector instead of class selector

1 Like

Thanks a lot. I solved the first part but it still gives me the section width error. I tried everything but it doesn’t work

please post your updated code