D
D
Darya Shvakh2020-06-23 05:40:45
css
Darya Shvakh, 2020-06-23 05:40:45

How to set @media at once in width and height?

iPhone 6/7/8 and iPhone X have the same width - 375px. And their height is different, X has it more.
How to set for X? By height? But then these styles will conflict with the 1080 * 812 breakpoint. Is it possible to set the width and height at once? @media@media

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
maxgeor, 2020-06-23
@maxgeor

The solution is the following - through a fraction, the ratio of width to height

@media screen and (device-aspect-ratio: 375/812) {
    .ep-box_1 {
       ....
    }
}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question