<style>
.grid {
display: grid;
gap: 20px;
}
.grid--gallery {
grid-template-columns: repeat(4, 1fr);
}
.image {
position: relative;
}
.image.is-square {
padding-top: 100%;
}
.image img {
position: absolute;
inset: 0;
/*
Use this if inset is not supported
top: 0;
right: 0;
bottom: 0;
left: 0;
*/
width: 100%;
height: 100%;
object-fit: cover;
z-index: 1;
}
</style>
<div class="grid grid--gallery">
<div class="grid__item">
<div class="image is-square">
<img src="[IMAGE_URL]" alt="[IMAGE_ALT]" />
</div>
</div>
<!-- Repeat grid__item for all images in gallery -->
</div>
Code Example |
---|
Html :: Headings |
Html :: h5 in html |
Html :: learn how to program html |
Html :: Tagging with multi-value select boxes |
Html :: html form to google sheets |
Html :: line break html |
Html :: boarder color of type text |
Html :: html make card |
Html :: nunjucks loop n times |
Html :: HTML <sup |
Html :: prettier html formatting |
Html :: is it illegal to hunt polar bears |
Html :: mat-icon outline |
Html :: email link with cc html |
Html :: react uncontrolled input initial value |
Html :: common web server ports |
Html :: type button on form |
Html :: venobox cdn |
Html :: favicon icon 404 error for html 5 |
Html :: bootstrap slider |
Html :: examples of metadata |
Html :: md-autocomplete |
Html :: detailed list html |
Html :: html class |
Html :: haml to html |
Html :: navbar in rows in bootstrap |
Html :: what is radio button in html used for |
Html :: how to set option size to select in html css |
Html :: Mega Menu ADA Compliance |
Html :: Two way binding html templatevue js |