Skip to content

Instantly share code, notes, and snippets.

@rpsthecoder
Last active March 28, 2019 05:40
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 rpsthecoder/ad22acaec9987e0fbe0b54b0145527e4 to your computer and use it in GitHub Desktop.
Save rpsthecoder/ad22acaec9987e0fbe0b54b0145527e4 to your computer and use it in GitHub Desktop.
<head>
<style>
#grid{
display: grid;
grid-template-areas: "one two three"; /* more style */
}
.griditems:nth-of-type(1){ grid-area: one; }
.griditems:nth-of-type(2){ grid-area: two; }
.griditems:nth-of-type(3){ grid-area: three;}
.griditems{
margin: auto; /* more style */
}
</style>
</head>
<body>
<div id="grid">
<img src="foo.com/img-1.jpg" class="griditems">
<img src="foo.com/img-2.jpg" class="griditems">
<img src="foo.com/img-3.jpg" class="griditems">
</div>
</body>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment