.feature-grid-item { /* outer containers */ &-outer { position: relative; display: inline-block; width: 160px; height: 250px; margin: 0 -4px 0 0; padding: 10px; &__wide { width: 250px; height: 160px; } } /* item tile */ position: relative; display: block; height: 100%; margin: 0; padding: 5px; background: #fff; border: 1px solid #ccc; border-radius: 5px; overflow: hidden; transition: border-color 500ms ; /* image */ &-img { width: 100%; height: 90%; height: calc( 100% - 2em ); background-size: 100%; background-size: contain; background-repeat: no-repeat; background-position: 50%; &__fill { background-size: cover; } } /* caption */ &-caption { position: absolute; bottom: 0; left: 5px; right: 5px; padding: 0.5em 1em; color: #000; background: #fff; font-size: 0.8em; text-align: center; } } /* */ body { color: #fff; background: #7a7480; @include background-image(linear-gradient(top, #474150, #7a7480)); background-repeat: no-repeat; font-family: avenir, sans-serif; font-size: 16px; } .example-img { max-width: 200px; max-height: 200px; margin: 0 20px 0 0; padding: 10px; background: #fff; }