Background Position

Set the background image position within an element.

Widely available

This feature is well established and works across many devices and browser versions.

Chrome
Edge
Firefox
Safari

Usage

<div class="d-g g-1 gtc-3">
<div class="w-24 h-24 bp-lt" style="background-image:url(/img/clivia.jpg)"></div>
<div class="w-24 h-24 bp-t" style="background-image:url(/img/clivia.jpg)"></div>
<div class="w-24 h-24 bp-rt" style="background-image:url(/img/clivia.jpg)"></div>
<div class="w-24 h-24 bp-l" style="background-image:url(/img/clivia.jpg)"></div>
<div class="w-24 h-24 bp-c" style="background-image:url(/img/clivia.jpg)"></div>
<div class="w-24 h-24 bp-r" style="background-image:url(/img/clivia.jpg)"></div>
<div class="w-24 h-24 bp-lb" style="background-image:url(/img/clivia.jpg)"></div>
<div class="w-24 h-24 bp-b" style="background-image:url(/img/clivia.jpg)"></div>
<div class="w-24 h-24 bp-rb" style="background-image:url(/img/clivia.jpg)"></div>
</div>

Responsiveness

Use breakpoint prefixes to target different screen sizes. Styles apply from the breakpoint & up.

Target viewport sizes with breakpoint prefixes.

sm:bp-*
Small640px
md:bp-*
Medium768px
lg:bp-*
Large1024px
xxl:bp-*
Extra Large1536px

Hover State

Apply styles conditionally on hover using the h: prefix.

Add the h: prefix to apply styles only when the user hovers over the element.

Syntax:h:bp-*