Skip to content

Background Position

Set background position

Syntax

visual="bg-pos:[value]"

Values

ValueCSS OutputDescription
centerbackground-position: centerCenter position
topbackground-position: topTop position
bottombackground-position: bottomBottom position
leftbackground-position: leftLeft position
rightbackground-position: rightRight position
top-leftbackground-position: top leftTop left
top-rightbackground-position: top rightTop right
bottom-leftbackground-position: bottom leftBottom left
bottom-rightbackground-position: bottom rightBottom right

Examples

html
<div visual="bg-pos:center">Centered background</div>

Preview

Background Position

visual="bg-pos:center" - Position background image

center
top
bottom
View Code
html
<div layout="flex" space="g:medium p:medium" visual="bg:neutral-100 dark:bg:neutral-900 rounded:medium">
  <div space="p:small" visual="bg:primary text:white rounded:small">center</div>
  <div space="p:small" visual="bg:primary text:white rounded:small">top</div>
  <div space="p:small" visual="bg:primary text:white rounded:small">bottom</div>
</div>

Arbitrary Values

Supports custom values using bracket syntax:

html
<div visual="background:[custom-value]">Custom</div>