We can either have overflow or empty space inside the track. item size defined and track size defined: There is no size relation between both, we simply place the item inside the track.item size not defined and track size defined: The item will be stretched to fill the track size (we may have overflow depending on the content of the item).
You can explicitely set the track sizes using different properties like grid-template-columns grid-template-rows and you will notice that grid item size will not always follow the size of the tracks and we may have overflow: In the previous example we didn't define any explicit size so the item width/height will also define the size of the track. You will not find a property called grid-area like you won't find a property called background, margin, border etc because all will get replaced by the longhand notation.Ĭonsidering the size, you should make the difference between the size of the tracks and the size of the items.
You can inspect the second element and you will have the computed value like this: There isn't any order but only one configuration will be considered for your item. This is logical since we are overriding properties. You can clearly see that we have a different result because of the order.