Overlay

Create an image overlay, which comes in different styles.

Overlay

Create an image overlay, which comes in different styles.

Usage

Add the .uk-overlay class to an element following an image to create the overlay panel. To create a position context, add the .uk-inline class from the Utility component to a container element around both. Finally, add one of the .uk-position-* classes from the Position component to align the overlay.

<div class="uk-inline">
    <img src="" width="" height="" alt="">
    <div class="uk-overlay uk-position-bottom"></div>
</div>

Note Add the .uk-light or .uk-dark class, so that elements will be optimized for better visibility on dark or light images.


Style modifiers

By default, the overlay has padding, but no additional styling. Add one of these modifier classes to add a background color to the overlay.

Default

For a simple background color, add the .uk-overlay-default class.


Primary

For a prominent background color, add the .uk-overlay-primary class.


Overlay icon

To display an overlay icon, add the uk-overlay-icon attribute to a <span> element inside the overlay.

<div class="uk-position-center">
    <span uk-overlay-icon></span>
</div>

Position

Add one of the .uk-position-* classes from the Position component to align the overlay.

<div class="uk-overlay uk-position-top"></div>