Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

CSS CSS Grid Layout Introducing Grid Layout Understanding Grid Challenge

chinedum onwuaso
chinedum onwuaso
814 Points

How do I put a CSS rule into a grid container?

How does it work?

style.css
/* Complete the challenge by writing CSS below */
index.html
<!DOCTYPE html>
<html>
  <head>
    <title>CSS Grid Layout</title>
      <link href='https://fonts.googleapis.com/css?family=Varela+Round' rel='stylesheet' type='text/css'>
    <link href="page.css" rel="stylesheet">
    <link href="style.css" rel="stylesheet">
  </head>
  <body>
    <div class="container">
      <div>1</div>
      <div>2</div>
      <div>3</div>   
    </div>
  </body>
</html>

1 Answer

Steven Parker
Steven Parker
231,198 Points

You might want to review this part of the Defining a Grid video to see an example.

For the first challenge task, you only need to target the class (note that it's different from the one in the video) and define the display type.

Steven Parker
Steven Parker
231,198 Points

As the instructor says, "A grid container is defined by setting an element's display property to grid." He then shows this done in the video.

Just to be sure, this is an intermediate-level course. You're already familiar with CSS Basics, right? Otherwise, you might want to do that course first!