Atomic Bulldog - UI/pattern library

1.7 - Media cover

Source: atoms/_media-and-bg-cover.scss, line 85

Open in new window

.media-cover

Default position is center center

Examples:

Default styling
Alternative text
.is-top-left

Top left

Alternative text
.is-top-center

Top center

Alternative text
.is-top-right

Top right

Alternative text
.is-center-left

Center left

Alternative text
.is-center-right

Center Right

Alternative text
.is-bottom-left

Bottom left

Alternative text
.is-bottom-center

Bottom center

Alternative text
.is-bottom-right

Bottom right

Alternative text
<div style="max-width: 500px"> <!-- Just for kss -->
 <div class="aspect-ratio-container is-silver">
   <div class="aspect-ratio-content">
     <img class="media-cover [modifier]"
     srcset="https://source.unsplash.com/random?preset=contain-xs 320w,
     https://source.unsplash.com/random?preset=contain-sm 570w,
     https://source.unsplash.com/random?preset=contain-md 860w,
     https://source.unsplash.com/random?preset=contain-lg 1150w,
     https://source.unsplash.com/random?preset=contain-xl 1400w"
     src="https://source.unsplash.com/random?preset=contain-xl"
     alt="Alternative text">
   </div>
 </div>
</div>