Skip to content

Object Position

Use object position utilities like object-top-left and object-bottom-right to specify how a replaced element’s content should be positioned within its container. These map to Flutter’s FittedBox.alignment (or the alignment parameter of Image when used directly) so that images and other replaced content align inside a cropped viewport.

Style('object-top-left ...', child: Image.network('/img/mountains.jpg'))
Style('object-top ...', child: Image.network('/img/mountains.jpg'))
Style('object-top-right ...', child: Image.network('/img/mountains.jpg'))
Style('object-left ...', child: Image.network('/img/mountains.jpg'))
Style('object-center ...', child: Image.network('/img/mountains.jpg'))
Style('object-right ...', child: Image.network('/img/mountains.jpg'))
Style('object-bottom-left ...', child: Image.network('/img/mountains.jpg'))
Style('object-bottom ...', child: Image.network('/img/mountains.jpg'))
Style('object-bottom-right ...', child: Image.network('/img/mountains.jpg'))
ClassAlignment
object-top-leftAlignment.topLeft
object-topAlignment.topCenter
object-top-rightAlignment.topRight
object-leftAlignment.centerLeft
object-centerAlignment.center
object-rightAlignment.centerRight
object-bottom-leftAlignment.bottomLeft
object-bottomAlignment.bottomCenter
object-bottom-rightAlignment.bottomRight
  • Keyword, e.g. object-[top-left] — resolves to the named Alignment.
  • Percentage pair, e.g. object-[25%_75%] — normalized to [-1..1]. 25%_75%Alignment(-0.5, 0.5).

Pixel values (e.g. object-[4px_8px]) are not supported — Flutter’s Alignment is normalized rather than pixel-based.