FAQ: Advanced CSS Grid - Align Content

This community-built FAQ covers the “Align Content” exercise from the lesson “Advanced CSS Grid”.

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

Learn CSS

FAQs on the exercise Align Content

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!

Hi, when I click on the reply button to ask a question nothing happens.

Please help.

I tried to enter the lesson’s example code into a test page to visualize everything for myself but the property “rows” wasn’t recognized. I replaced it with “grid-template-rows” and everything seemed to work as intended. Not sure if this is an error or it’s some shorthand I’m just not familiar with and Notepad++ isn’t picking it up. Just throwing it out there for my fellow visual learners!

HTML:

<!DOCTYPE html>
<html>

<link href="./test.css" type="text/css" rel="stylesheet">

<!--TESTING SPACE-->

<main>
  <div class="top">Top</div>
  <div class="bottom">Bottom</div>
</main>

<!--TESTING SPACE-->

</html>

CSS:

main {
  display: grid;
  height: 600px;
  grid-template-rows: 200px 200px;
	border: solid black 1px;
  grid-template-areas: "top"
                       "bottom"; 
  align-content: center;
}

.top {
	color: red;
	border: solid black 1px;
}

.bottom {
	color: blue;
	border: solid black 1px;
}

View in Firefox:

1 Like

Anyone else just happily following along to these step by step instructions getting the right answers, but not actually learning anything or even undertanding the difference between align content and align items???

2 Likes

yes “rows” should be “grid-template-rows”
it is still not changed in the example they have provided, I’m currently learning it and I was really confused at first that it is not possible to generate rows with that property.
Hence I came here to check.

maybe they testing our gained knowledge

1 Like

Whats different between align-content: space-evenly and align-content: space-around?

1 Like

Welcome to the forums!

space-evenly will apply an equal amount of space between the grid items and at the ends, while space-around applies an equal amount of space on each side of each grid item.

space-evenly:
| a a a a a |

space-around:
| a  a  a  a  a |
1 Like

That is exactly why I stop after each chapter to check in with myself and see if i need further explaination. I reccomend using multiple learning resources. After finishing a lesson try to put it into practice in codepen or something of the sort, or work on an experimental personal project and integrate what you learn in each lesson on it, and watch videos and do some google searches. That’s helped me tons. :slight_smile: