Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save steveclarke/bbbd3a15de97de2a26f47578fbb1c69a to your computer and use it in GitHub Desktop.
Save steveclarke/bbbd3a15de97de2a26f47578fbb1c69a to your computer and use it in GitHub Desktop.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<style>
/* https://css-tricks.com/a-grid-of-logos-in-squares/ */
.grid {
display: grid;
grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
grid-gap: 2rem;
}
.grid > div {
background: black url('https://picsum.photos/200');
display: grid;
border-radius: 50%;
}
/* padding hack to set ratio to square */
.grid > div::before {
content: "";
padding-bottom: 100%;
display: block;
}
</style>
<body>
<div class="grid">
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
</div>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment