Designing a Magazine layout

*Failed: 7. Your .magazine-cover should have a grid-template-areas property with title spanning all three columns of the first row.

  • Failed:8. The second row of the grid template should contain a feature article spanning two columns and a cover image.

  • Failed:9. The third row of the grid template should contain small-article1, small-article2, and cover-image.


    .magazine-cover {
        display: grid;
        grid-template-areas: "title title title" "feature-article feature-article cover-image" "small-article1  small-article2 cover-image";
        grid-template-columns: 1fr 1fr 1fr;
        grid-template-rows: auto 1fr 1fr;
        gap: 10px;
        width: 80vw;
        height: 180vh;
        padding: 10px;
        background-color: var(--color0);
        box-sizing: border-box;
    }

please post a link to the project

Thank, I have edited your post to make your link visible.

Here are some troubleshooting steps you can follow. Focus on one test at a time:

  • What is the requirement of the first failing test?
  • Check the related User Story and ensure it’s followed precisely.
  • What line of code implements this?
  • What is the result of the code and does it match the requirement? (Write the value of a variable to the console at that point in the code if needed.)
  • Are there any errors or messages in the console?

If this does not help you solve the problem, please reply with answers to these questions.

But so you are aware, I am testing your code and I do not see tests 7,8,9 failing

The issue is that the code is correct but i don’t know why the test is falling

then please share your code, a small piece is not enough for debugging

It would really help if you answer the questions above.

They will provide all the information needed to discover why the test is failing.

<!DOCTYPE html>
<html lang="en">

<head>
<meta charset="utf-8">
<title>Magazine Layout</title>
<link rel="stylesheet" href="styles.css" />
</head>

<body>
  <main class="magazine-cover">
    <header class="title">The Edit By KceeCollection</header>
    <section class="feature-article">
      <h4>Urban Style, Redefined</h4>
      <p>In the heart of the city, style is more than clothing—it's a language. It's the subtle confidence in a well-fitted jacket, the bold statement of a bright sneaker, the understated charm of a tailored shirt. At KceeCollection, we believe fashion is the soundtrack to your everyday life, setting the tone for how you move, speak, and leave your mark.</p>
    </section>
    <section class="small-article1">
      <h4>Where Comfort Meets Class</h4>
      <p>Gone are the days when style meant sacrificing comfort. Our designs fuse breathable fabrics with clean, modern cuts that let you move with ease. Whether it's a retro jersey that turns heads or joggers that feel like a second skin, every piece is crafted to match your lifestyle—dynamic, bold, and unapologetically you.</p>
    </section>
    <section class="small-article2">
      <h4>The Details Tell the Story</h4>
      <p>Look closely and you'll find the little things that set our collection apart. Hand-finished stitching, colors that pop in natural light, zippers and buttons chosen with precision—these details aren't just design choices, they're part of the story your outfit tells the world. Because in fashion, small things often make the loudest statement.</p>
    </section>
    <section class="cover-image">
      <img src="logo.png" alt="Kceecollection brand logo" />
    </section>
  </main>
</body>

</html>
:root {
  --color0: #FFC1C1;
  --color1: #FF7F7F;
  --color2: #FF4C4C;
  --color3: #FF0000;
  --color4: #B22222;
  --color5: #800000;
  --color6: linen;
}

body {
  padding: 0;
  margin: 0;
  font-size: 14px;
  font-family: sans-serif;
  display: flex;
  justify-content: center;
  align-items: center;
  background: linear-gradient(to bottom, var(--color0) 17%, var(--color1) 34%, var(--color2)50%, var(--color3) 67%, var(--color4) 84%, var(--color5) 100%);
  background-repeat: no-repeat;
  background-attachment: fixed;
 overflow: auto; 
}

.magazine-cover {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  grid-template-rows: auto 1fr 1fr;
  grid-template-areas: 
  "title title title" 
  "feature-article feature-article cover-image" 
  "small-article1  small-article2 cover-image";
  gap: 10px;
  width: 80vw;
  height: 180vh;
  padding: 10px;
  background-color: var(--color0);
  box-sizing: border-box;
}

.magazine-cover .title {
  text-align: center;
  width: 80%;
  margin: auto;
}

.title {
  font-size: 1.5rem;
  font-family: Serif;
  font-weight: bold; 
  grid-area: title;
  padding: 10px;
  background-color: #fff;
}

.feature-article {
  grid-area: feature-article;
  padding: 0 10px;
  background-color: #fff;
}

.small-article1 {
  grid-area: small-article1;
  padding: 0 10px;
  background-color: #fff;
}

.small-article2 {
  grid-area: small-article2;
  padding: 0 10px;
  background-color: #fff;
}

.cover-image {
  grid-area: cover-image;
  width: 400px;
  height: 400px;
}

p {
  font-style: italic;
}

@media only screen and (max-width: 1024px) {
  .magazine-cover {
    height: 120vh;
    width: 90vw;
    font-size: 14px;
  }

  .cover-image {
    width: 200px;
    height: 100%;
  }
}

@media only screen and (max-width: 767px) {
  .magazine-cover {
    height: 170vh;
    width: 80vw;
  }

  .cover-image {
    width: 200px;
    height: 100%;
  }
}

@media only screen and (max-width: 640px) {
  .magazine-cover {
    height: 200vh;
    width: 90vw;
    font-size: 12px;
  }

  .cover-image {
    width: 200px;
    height: 100%;
  }
}

@media only screen and (max-width: 480px) {
  .magazine-cover {
    height: 155vh;
    width: 80vw;
    font-size: 12px;
    grid-template-columns: 1fr;
    grid-template-rows: auto auto auto auto;
    grid-template-areas: "title" "cover-image" "feature-article" "small-article1" "small-article2";
  }

  .cover-image {
    width: 200px;
    height: 100%;
  }
}

I’ve edited your post to improve the readability of the code. When you enter a code block into a forum post, please precede it with a separate line of three backticks and follow it with a separate line of three backticks to make it easier to read.

You can also use the “preformatted text” tool in the editor (</>) to add backticks around text.

See this post to find the backtick on your keyboard.
Note: Backticks (`) are not single quotes (').

Here are some troubleshooting steps you can follow. Focus on one test at a time:

  • What is the requirement of the first failing test?
  • Check the related User Story and ensure it’s followed precisely.
  • What line of code implements this?
  • Are there any errors or messages in the console?

If this does not help you solve the problem, please reply with answers to these questions.

I have checked and yet I couldn’t find what the issue was.

can you please try to answer the questions in written form?

  1. Your .magazine-cover should have a grid-template-areas property with title spanning all three columns of the first row.
  2. Done that.
  3. CSS.
  4. No.

Can you identify and show the line of CSS please?

.magazine-cover {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  grid-template-rows: auto 1fr 1fr;
  grid-template-areas: 
  "title title title" 
  "feature-article feature-article cover-image" 
  "small-article1  small-article2 cover-image";
  gap: 10px;
  width: 80vw;
  height: 180vh;
  padding: 10px;
  background-color: var(--color0);
  box-sizing: border-box;
}

It looks like all of the screen size breakpoints are messing with the test. If the automated test receives the settings from a smaller screen size, title will no longer span by 3.

You should not really add anything extra that isn’t asked for in the tests. After you pass the tests you can add extra elements if you want to spruce it up as a portfolio piece.

For now you can jut remove all of the breakpoints since they aren’t asked for.

Thank you this was helpful

1 Like