C
C
chelnokov_a2020-10-17 23:11:25
css
chelnokov_a, 2020-10-17 23:11:25

Why doesn't the image keep aspect ratio in safari browser?

Hello. I'm working on a layout and I've run into this problem. For images that have a transform property, when the screen is reduced, I reduce the width so that the image becomes proportionally smaller. However, in the safari browser, the height of the image remains unchanged, which causes it to stretch.

Stretching was solved easily with the help of the object-fit property. However, since the height remains the same, the layout still floats. Does anyone know how to solve this problem. If anything, here is the layout https://pateder.ru/Development/sineo/

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Victor P., 2020-10-23
@Jeer

Good afternoon,
How do you set the transform? )
Some properties do work differently in different browsers. If your problem is exactly "transform safari", just write in Google and the first links will give you something like this:

-webkit-transform: translate(-50%, -50%);
  transform: translate(-50%, -50%);

Also look for special sites that check / add cross-browser compatibility for css

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question