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 () 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 () below!
Agree with a comment or answer? Like () to up-vote the contribution!
"
2. The container has three grid items that do not have a specified width.
3. Without setting the align-items property, these elements will span the height of the row they are in (400 pixels).
"
This section of Align Items is a direct copy of theJustify Items exercise, but should’nt the word width in 2. have been replace with height as we are now talking about block level alignment and rows?
I think tysker86 is right. The grid-template-rows property specifies the height of each grid row, but not the height of each item. These two heights are different. That’s why the align-items property can make a difference by setting where to vertically locate an item inside the grid row.
In this lesson, setting the value of “align-items” to “stretch” gives us the same result as not using the property at all. Since the default behaviour of items is to take up the whole row, when would we use “align-items: stretch;”?
To override other declarations. Say we had many grids with classes of grid and we set their align-items property to start, but we wanted the grid with an class of stretch to have an align-items property of stretch, we could simply select it and do just that
Can someone explain to me why are they called “justify-items” & “justify-content”? Why “justify”? It helps me to understand the functions of the code which helps me to rmb it. Appreciate any clarifications so that i can move on. Thank you!
Why is it that when I add a bunch of text to the meal description, it overflows the column? I was expecting it to stay inside the column and stretch it as we are told about the divs when you use align-items:
They will only be as tall as necessary to contain their content (the words Card 1, etc).
I think the reason why it is overflowing is because we already specify the height which is 450px. So adding more text to it, the text is going to overflow the 450px height which is already defined.
I get what you trying to say. But if we specify the height for the grid-items, the items are not going to stretch, even if we defined align-items: stretch on the grid-container.
Same rule also apply to the justify-items (Note this time we are working with the width not height).
My understanding is that without specifying a height, or ‘align-items: stretch,’ the items will expand as necessary to fit their content. If so, why if I keep all the ‘align-items’ properties commented out do the items still remain the size of their rows? Why aren’t they just big enough to cover the necessary content?
Is this because stretch is the default value? If this is the case, why is it necessary to specify it?