FAQ: CSS Grid Essentials - Creating a Grid

This community-built FAQ covers the “Creating a Grid” exercise from the lesson “CSS Grid Essentials”.

Paths and Courses
This exercise can be found in the following Codecademy content:

Learn CSS

FAQs on the exercise Creating a Grid

There are currently no frequently asked questions associated with this exercise – that’s where you come in! You can contribute to this section by offering your own questions, answers, or clarifications on this exercise. Ask or answer a question by clicking reply (reply) below.

If you’ve had an “aha” moment about the concepts, formatting, syntax, or anything else with this exercise, consider sharing those insights! Teaching others and answering their questions is one of the best ways to learn and stay sharp.

Join the Discussion. Help a fellow learner on their journey.

Ask or answer a question about this exercise by clicking reply (reply) below!

Agree with a comment or answer? Like (like) to up-vote the contribution!

Need broader help or resources? Head here.

Looking for motivation to keep learning? Join our wider discussions.

Learn more about how to use this guide.

Found a bug? Report it!

Have a question about your account or billing? Reach out to our customer support team!

None of the above? Find out where to ask other questions here!

My code was

.grid {
  border: 2px blue solid;
  width: 400px;
  height: 500px;
  display: grid;
}

.box {
  background-color: beige;
  color: black;
  border-radius: 5px;
  border: 2px dodgerblue solid;
}

and the solution was

.grid {
  border: 2px blue solid;
  width: 400px;
  height: 500px;
  display: grid;
}

.box {
  background-color: beige;
  color: black;
  border-radius: 5px;
  border: 2px dodgerblue solid;
}

But somehow mine was wrong…? I’m working on a small screen so maybe I just can’t see it, but I can’t tell what difference there is between these two.

That’s weird – it looks like you did everything perfect.

Sometimes the Code Academy interface will ‘time out’ and I have to reload the page and run the code again for it to work.

1 Like

What’s the difference between building a table and a grid?

4 Likes

You can basically achieve the same thing with tables and CSS grid. However, you should use CSS grid as CSS should take care of all the styling and layout while HTML should take care of the content and structure