General Flashcards
css: box-sizing: border-box
Makes the size inclusive of border and padding
css: margin: 0 auto;
helps to centre horizontally, a width must be set for it to work
css: .breadcrumb li+li::before {
content: “>”;
}
Separator in breadcrumbs
css: display: flex;
Or. display: inline-flex
Designate an item as a flex container
css {
justify-content: flex-start;
flex-end;
centre;
space-around;
space-between
Five commonly used options to distribute within a flex-container.
css {
align-items: flex-start;
flex-end;
center
baseline;
stretch;
5 commonly used align-items properties to flex vertically -cross axis- within a flex-container
css {
flex-basis: npx
}
To specify a width of an item before it stretches or shrinks.
css {
flex-wrap: wrap;
wrap-reverse;
no-wrap;
Use on containers to apply to child items
css {
align-content: flex-start;
flex-end;
center;
space-between;
space-around;
stretch;
For aligning multiple rows vertically in a flex container. essentially shares values with align items.
css: {
flex-flow:
Shorthand for flex direction and flex-wrap (in this order).
css {
flex: (flex-grow flex-shrink flex-basis)
Flex is shorthand for the 3 values
css {
display: grid;
}
Setup a grid!
css: cursor: pointer;
Change the arrow to a point hand
css: ELEMENT:hover {
pseudo class to do something when the cursor is over it
css {
gap: rowpx colpx;
}
Set row and column spacing
CSS {
grid-template-ROWS/COLUMNS: npx minmax(npx, npx) npx;
}
Define rows or columns sizes with middle one having size limits set for scaling
CSS {
grid-template-ROWS/COLUMNS: repeat(n, 100px)
}
Repeat a unit size n times
CSS {
grid-template: npx n% nfr / n% npx;
}
Shorthand for grid-template-ROWS/COLUMNS
Actually laid out rows / columns
CSS {
grid-row: n / n;
(or grid-column)
}
Short hand for row-start and row-end (in that order)
CSS {
grid-area: rowStart / colStart / row end / col end;
}
Short hand for grid-row and grid-column combined
css {
grid-template-areas:
“header header”
“left right “
“footer footer”;
}
Allows you to name sections (elements or classes) to define grid-row-start etc.
Declare it in the grid container
CSS {
grid-area: left/right/footer;
}
How to define a grid area for an grid element within a grid container
css {
z-index: 5;
}
Brings an object forward or back in layers (especially in grid overlaps)
CSS {
grid-auto-COLUMNS/ROWS;
Specifies the HEIGHT/WIDTH of those implicitly added to the grid