@mixin responsive-bg-image($image-width, $image-height) { background-size: 100%; height: 0; padding-bottom: percentage($image-height / $image-width); display: block; } .my-element { background: url("maxi.png") no-repeat; // substitute for your image dimensions @include responsive-bg-image(204, 81); }