Oleg Oleg - 1 year ago 50
HTML Question

Safari Mobile and object-position css

I have a question regarding Safari Mobile and CSS


I've tried to use it, but it doesn't work for me.

I've seen 2 different answers(Safari Mobile supporting this property and doesn't support)

There is my example:

img {
object-position: 0 -300px;
width: 112px;
height: 50px;
display: block;
float: left;
margin-right: 10px;

I'm using CSS sprites for menu icons as
, not as

How I can solve this issue?

Answer Source

iOS safari does support object-fit however doesn't support object-position

See Can I use CSS3 object-fit/object-position ?

1 Partial support in Safari refers to support for object-fit but not object-position.


A possible solution is using background with background-position

Here is a good article about CSS sprites