9504 shaares
222 private links
222 private links
Put all the items in the same cells
header {
display: grid;
grid-template-areas: "heros";
> * {
grid-area: hero;
}
}
Hero 1 summary
object-fit
used to controlimg
size
align-items: center
used to vertically align the grid children
Hero 2 summary
created a color screen over the
img
by definingbackground-color
of theheader
withrgba
and addingz-index: -1
to theimg
to slide it behind theheader
used pseudo-elements for additional design flair, and positioned them separately from the parent grid definition withplace-self
Hero 3 summary
use of a wrapper to provide a secondary grid layout for content versus
header
design elements
creation of auto-width columns withgrid-template-columns
Leveragingvmin
to minimize padding on smaller viewports and increase it for larger viewports