htmlcsssafari

how to make the background display full screen (Safari)


On Safari phones, I get a terrible white stripe on top. I would like it to be filled with background My site

For example, on this site, there is no such strip on top Example

HTML file:

<!DOCTYPE html>
<html lang="ru">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge"/>
    <meta name="viewport" content="width=device-width, initial-scale=1.0, viewport-fit=cover">
    <title>Авторизация</title>
    <link rel="stylesheet" href="/css/login.css?v=1.1.4">
</head>
<body>
    <div class="container-border active">
    </div>
</body>
</html>

CSS file:

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    color: white;
}

html, body {
    height: 100vh;
    overflow-y: hidden;
    background: linear-gradient(180deg, hsl(250, 15%, 30%), hsl(250, 15%, 10%));
}

body {
    display: flex;
    align-items: center;
    justify-content: center;
}

Solution

  • I suppose you mean changing the color of the status bar?

    Try to add apple-mobile-web-app-status-bar-style meta tag. You can checkout the 'Changing the Status Bar Appearance' of this page

    <meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
    

    Or, you can try to add theme-color meta tag. theme-color