Backgrounds

Background Position

Utilities for sets position of a background image.


Variant

Active Checked Child-Selection Dark Mode Disabled Expand First-Last-Selection First-Letter Focus Focus-Visible Focus-Within Fullscreen Group-Focus Group-Hover Hover Landscape Light Mode Portrait Reduce-Motion Responsive Selection-Hover Visited

API

classcss
bg-topbackground-position: top
bg-bottombackground-position: bottom
bg-centerbackground-position: center
bg-leftbackground-position: left
bg-left-bottombackground-position: left bottom
bg-left-topbackground-position: left top
bg-rightbackground-position: right
bg-right-bottombackground-position: right bottom
bg-right-topbackground-position: right top

Usage

Set left-top position background image with HTML inline attribute style="..." and a CSS property background-image: url(...) to an element.

<div class="bg-left-top ... bg-no-repeat ... height-32 width-64" style="background-image:url(...)">
...
</div>
HTML
.dummy {
@extend
.bg-left-top,
.bg-no-repeat,
.height-32,
.width-64;
}
SCSS

Set top position background image.

<div class="bg-top ... bg-no-repeat ... height-32 width-64" style="background-image:url(...)">
...
</div>
HTML
.dummy {
@extend
.bg-top,
.bg-no-repeat,
.height-32,
.width-64;
}
SCSS

Set right-top position background image.

<div class="bg-right-top ... bg-no-repeat ... height-32 width-64" style="background-image:url(...)">
...
</div>
HTML
.dummy {
@extend
.bg-right-top,
.bg-no-repeat,
.height-32,
.width-64;
}
SCSS

Set right position background image.

<div class="bg-right ... bg-no-repeat ... height-32 width-64" style="background-image:url(...)">
...
</div>
HTML
.dummy {
@extend
.bg-right,
.bg-no-repeat,
.height-32,
.width-64;
}
SCSS

Set right bottom position background image.

<div class="bg-right-bottom ... bg-no-repeat ... height-32 width-64" style="background-image:url(...)">
...
</div>
HTML
.dummy {
@extend
.bg-right-bottom,
.bg-no-repeat,
.height-32,
.width-64;
}
SCSS

Set bottom position background image.

<div class="bg-bottom ... bg-no-repeat ... height-32 width-64" style="background-image:url(...)">
...
</div>
HTML
.dummy {
@extend
.bg-bottom,
.bg-no-repeat,
.height-32,
.width-64;
}
SCSS

Set left-bottom position background image.

<div class="bg-left-bottom ... bg-no-repeat ... height-32 width-64" style="background-image:url(...)">
...
</div>
HTML
.dummy {
@extend
.bg-left-bottom,
.bg-no-repeat,
.height-32,
.width-64;
}
SCSS

Set left position background image.

<div class="bg-left ... bg-no-repeat ... height-32 width-64" style="background-image:url(...)">
...
</div>
HTML
.dummy {
@extend
.bg-left,
.bg-no-repeat,
.height-32,
.width-64;
}
SCSS

Set center position background image.

<div class="bg-center ... bg-no-repeat ... height-32 width-64" style="background-image:url(...)">
...
</div>
HTML
.dummy {
@extend
.bg-center,
.bg-no-repeat,
.height-32,
.width-64;
}
SCSS