V
V
Viktor Burdale2018-11-05 16:15:44
css
Viktor Burdale, 2018-11-05 16:15:44

Why doesn't this media query work in Safari browser?

Hello. Made the site. I checked it in popular browsers, everything is displayed as it should be, but in safari it's a problem .. I
adjust the display with media queries. Testing on Safari in responsive design mode. And I see that this code does not work in Safari on a mobile device:

@media (max-width: 320px) and (max-height: 600px) {
    header {
        height: 130vh;
    }
}

Only this code works:
header {
height: 100vh;
overflow: visible;
background: url(../../img/header-bg.jpg) no-repeat center center;
-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
background-size: cover;
}

A media query with a header is placed below the main header.
Other media queries work. There's just something wrong with this. I thought maybe the problem is in "vh", changed it to "px" - it did not help .. Please help with solving the problem. Where to dig?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Maxim Litvinov, 2018-12-08
@Max-GopheR

Maybe safari has a different height and gets a height of 605px for example? Try playing with height and width. Safari is so...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question