Tailwind CSS - Object Position



Tailwind CSS Object-Position is a utility class that provides an effective way of positioning an object within its container.

Tailwind CSS Object Position Classes

The following is the list of Tailwind CSS Object-Position Classes that provides an effective way placing an object within its container.

Class CSS Properties
object-bottom object-position: bottom;
object-center object-position: center;
object-left object-position: left;
object-left-bottom object-position: left bottom;
object-left-top object-position: left top;
object-right object-position: right;
object-right-bottom object-position: right bottom;
object-right-top object-position: right top;
object-top object-position: top;

Functionality of Tailwind CSS Object Position Classes

  • object-bottom: This class replaces the CSS object-position: bottom; property. This class places an object at the bottom of its container.
  • object-center: This class replaces the CSS object-position: center; property. This class places an object at the center of its container both vertically and horizontally.
  • object-left: This class replaces the CSS object-position: left; property. This class places an object at the left of its container.
  • object-left-bottom: This class replaces the CSS object-position: left bottom; property. This class places an object at the left-bottom of its container.
  • object-left-top: This class replaces the CSS object-position: left top; property. This class places an object at the left top of its container.
  • object-right: This class replaces the CSS object-position: right; property. This class places an object at the right of its container.
  • object-right-bottom: This class replaces the CSS object-position: right bottom; property. This class places an object at the right-bottom of its container.
  • object-right-top: This class replaces the CSS object-position: right top; property. This class places an object at the right top of its container.
  • object-top: This class replaces the CSS object-position: top; property. This class places an object at the top of its container.

Tailwind CSS Object Position Class Examples

The following examples will illustrate the Tailwind CSS Object Position class utility.

Object Top Positioning

Here in this example, we will see the usage of the three above mentioned classes, which can be used for top positioning.

Example





    



    

Tailwind CSS Object Position

Original Image


Tailwind CSS object-left-top Class

Tailwind CSS object-top Class

Tailwind CSS object-right-top Class

Object Center Positioning

Here in this example, we will see the usage of the three above mentioned classes, which can be used for center positioning.

Example





    



    

Tailwind CSS Object Position

Original Image


Tailwind CSS object-left Class

Tailwind CSS object-center Class

Tailwind CSS object-right Class

Object Bottom Positioning

Here in this example, we will see the usage of the three above mentioned classes, which can be used for bottom positioning.

Example





    



    

Tailwind CSS Object Position

Original Image


Tailwind CSS object-left-bottom Class

Tailwind CSS object-bottom Class

Tailwind CSS object-right-bottom Class

Advertisements