We use the media overlay object to position text content over an image or other piece of media.
Setting some content over a piece of media
Author: Mary Ditchen
Since: 0.9.0
Source: /source/patterns/objects/media-overlays.scss#L9
Ham bacon tempor eiusmod laboris salami sausage. Buffalo tempor chislic venison short loin rump. Elit brisket strip steak shoulder consectetur pork chop.
<!-- media overlay -->
<div class="o-media-overlay">
<div class="o-media-overlay__media">
<img class="o-media-overlay__image" src="https://placehold.it/2560x1024" alt="" />
<div class="o-media-overlay__image-overlay u-image--5x2" aria-hidden="true" focusable="false">
<!--overlay-->
</div>
</div>
<div class="o-media-overlay__content">
<p>Ham bacon tempor eiusmod laboris salami sausage. Buffalo tempor chislic venison short loin rump. Elit brisket strip steak shoulder consectetur pork chop.</p>
</div>
</div>
Author: Mary Ditchen
Since: 0.9.0
Source: /source/patterns/objects/media-overlays.scss#L156
<!-- media overlay with caption -->
<div class="o-media-overlay o-media-overlay--with-caption">
<div class="o-media-overlay__media">
<img class="o-media-overlay__image" src="https://placehold.it/2560x1920" alt="" />
<div class="o-media-overlay__image-overlay u-image--4x3" aria-hidden="true" focusable="false">
<!--overlay-->
</div>
</div>
<div class="o-media-overlay__content">
<h2>Heading</h2>
<p>Ham bacon tempor eiusmod laboris salami sausage. Buffalo tempor chislic venison short loin rump.</p>
</div>
<div class="o-media-overlay__caption">
<p>
<span class="c-pseudo-icon icon-info-stroke u-space-inline-right--xxs u-vertical-align-middle" aria-hidden="true" focusable="false">
<!-- icon -->
</span>
<span class="u-vertical-align-middle">Elit brisket strip steak shoulder consectetur pork chop.</span>
</p>
</div>
</div>
Author: Mary Ditchen
Since: 0.9.0
Source: /source/patterns/objects/media-overlays.scss#L241
<!-- media overlay stacked at mobile -->
<div class="o-media-overlay o-media-overlay--stacked\@mobile">
<div class="o-media-overlay__media">
<img class="o-media-overlay__image" src="https://placehold.it/2560x1280" alt="" />
<div class="o-media-overlay__image-overlay u-image--2x1" aria-hidden="true" focusable="false">
<!--overlay-->
</div>
</div>
<div class="o-media-overlay__content">
<h1 class="u-text-align-center">Heading</h1>
<ul class="o-inline-list o-inline-list--block">
<li class="o-inline-list__item">
<a class="c-button c-button--large" href="#">Button Link</a>
</li>
<li class="o-inline-list__item">
<a class="c-button c-button--large c-button--on-dark" href="#">Button Link</a>
</li>
</ul>
</div>
</div>
Author: Mary Ditchen
Since: 0.9.0
Source: /source/patterns/objects/media-overlays.scss#L295
<!-- media overlay justified to start -->
<div class="o-media-overlay o-media-overlay--justify-start">
<div class="o-media-overlay__media">
<img class="o-media-overlay__image" src="https://placehold.it/2560x853" alt="" />
<div class="o-media-overlay__image-overlay u-image--3x1" aria-hidden="true" focusable="false">
<!--overlay-->
</div>
</div>
<div class="o-media-overlay__content">
<h2>Heading</h2>
<p class="u-font-weight-light">Copy</p>
<a class="c-button" href="#">Button Link</a>
</div>
</div>