Last active
April 11, 2019 02:14
-
-
Save scottgruber/e21fefb75ff47ae5f4cf2f4eddfe80ef to your computer and use it in GitHub Desktop.
Card List component using CSS Grid, Flexbox and Semantic HTML
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.ioes-c-card-overlay-grid { | |
display: grid; | |
grid-gap: 2vw; | |
grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); | |
grid-template-rows: auto; | |
margin: 2vw; | |
} | |
.ioes-c-card-overlay figure { | |
display: flex; | |
position: relative; | |
} | |
.ioes-c-card-overlay img { | |
height: calc(350px * 9 / 16); | |
object-fit: cover; | |
width: 100%; | |
} | |
.ioes-c-card-overlay .bg-color { | |
background-color: rgba(0, 0, 0, 0.5); | |
height: 100%; | |
position: absolute; | |
top: 0; | |
width: 100%; | |
} | |
.ioes-c-card-overlay figcaption { | |
align-content: center; | |
justify-self: center; | |
left: 10%; | |
position: absolute; | |
text-align: center; | |
top: 30%; | |
width: 80%; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<section class="ioes-c-card-overlay-grid"> | |
<article class="ioes-c-card-overlay"> | |
<a href="#" rel="bookmark"> | |
<figure> | |
<img src="" alt="" /> | |
<div class="bg-color"></div> | |
<figcaption> | |
<h5 class="white">Title</h5> | |
<p class="yellow">Description</p> | |
</figcaption> | |
</figure> | |
</a> | |
</article> | |
</section> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment