Upcoming Webinar: Jump Start Your Automated Testing Efforts With Record & Play Save Your Seat

Blog We love to talk!

Nov Tue

Cross Browser object-fit/object-position

  •  11-10-2015

Object-fit/object-position is the method of specifying how an object (image or video) should fit inside its box. Object-fit options include “contain” (fit according to aspect ratio), “fill” (stretches object to fill) and “cover” (overflows box but maintains ratio), where object-position allows the object to be repositioned like background-image does.

Browser Support

This feature is already supported by a few major browsers including Chrome, Firefox and Opera.

Code Example

You can use object-fit/object-position like this:

object-fit: cover;

More Information

More information can be found here.

No Comments

Leave a Reply

Your email address will not be published.