CSS Grid Flashcards
How do you create a grid element?
display: grid
How do you add columns to a grid?
grid-template-columns:
How do you add rows to a grid?
grid-template-rows:
What units can you use to define the sizes of colums and rows?
px, em for set sizes
fr: sets the column or row to a fraction of the available space,
auto: sets the column or row to the width or height of its content automatically,
%: adjusts the column or row to the percent width of its container.
How do you add a gap between columns or rows?
grid-column-gap:
grid-row-gap:
What does grid-gap: do if you pass it one value?
Creates a gap between both columns and rows of the specified size
How do you align content vertically in the cell of a CSS grid?
justify-self:
What are the possible values of justify-self:?
stretch, which will make the content fill the whole width of the cell. This CSS Grid property accepts other values as well:
start: aligns the content at the left of the cell,
center: aligns the content in the center of the cell,
end: aligns the content at the right of the cell.
How do you align content horizontally in the cell of a CSS grid?
align-self:
How can you group grid cells into areas?
grid-template-areas:
“header header header”
“advert content content”
“footer footer footer”;
How do you designate an empty space in an area template?
.
How do you place an element with a given class in an area
.class-name {
grid-area: area;
}
How can you create an area template?
grid-area: 1/1/2/4;
what values do the numbers represent in grid-area: 1/1/2/4;?
grid-area: horizontal line to start at / vertical line to start at / horizontal line to end at / vertical line to end at;
what function can be used to create multiple rows or columns?
repeat