css – Problem with Background Image using Bootstrap 3

Question:

I'm having a problem in displaying the background image when the site is accessed by Chrome on the smartphone, on the PC it normally presents (responsive).

HTML:

<!DOCTYPE HTML>
<html lang="pt-br">
    <head>
        <meta charset="utf-8">
        <meta http-equiv="X-UA-Compatible" content="IE=edge">
        <meta name="viewport" content="width=device-width, initial-scale=1">
        <title>Gazela Fotos</title>
        <link href="css/bootstrap.min.css">
        <link href="css/teste.css">
        <link href='https://fonts.googleapis.com/css?family=Ubuntu' rel='stylesheet' type='text/css'>
        <link href="imagens/favicon.ico" type="image/x-icon">
    </head>
    <body class="background-home" onload="inicializaPagina();">
        <div class="container-fluid">
            <nav class="navbar navbar-inverse navbar-fixed-bottom menu">
                <div class="container">
                    <div class="navbar-header">
                        <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#teste" aria-expanded="false">
                            <span class="sr-only">Toggle navigation</span>
                            <span class="icon-bar"></span>
                            <span class="icon-bar"></span>
                            <span class="icon-bar"></span>
                        </button>
                        <a class="navbar-brand menu-titulo" href="#">Teste</a>
                    </div>
                    <div id="teste" class="collapse navbar-collapse">
                        <ul class="nav navbar-nav">
                            <li><a href="#" class="menu-opcoes menu-selecionado">Home</a></li>
                            <li><a href="#" class="menu-opcoes">Sobre</a></li>
                            <li><a href="#" class="menu-opcoes">Contato</a></li>
                        </ul>
                    </div>
                </div>
            </nav>
        </div>
        <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.2.2/jquery.min.js"></script>
        <script src="js/bootstrap.min.js"></script>
        <script src="js/teste.js"></script>
    </body>
</html>

CSS:

.background-home {
    background: url("../imagens/background-home.jpg") no-repeat center top fixed;
    background-size: cover;
}

.redes-sociais {
    display: none;
    width: 100%;
    margin-top: 15px;
    text-align: right;
}

.menu {
    display: none;
    background-color: rgba(0,0,0,0.7);
}

.menu-titulo {
    font-family: 'Ubuntu', sans-serif;
    font-size: 26px;
    color: #FFF !important;
}

.menu-opcoes {
    font-size: 16px;
}

.menu-selecionado {
    color: #FFF600 !important;
}

Because the background image is not displayed responsive when the site is accessed by smartphone, could someone give me a light?

Answer:

From what I saw in caniuse the cover is only supported on version 49 of Chrome for Android.

List supported browsers: http://caniuse.com/#feat=object-fit

I believe the best thing to do in this case is to use vendor properties known as vendor-prefix to ensure greater compatibility.

Example:

html {
  background: url(http://i.imgur.com/tENv1w4.jpg) no-repeat center center fixed;
  -webkit-background-size: cover;
  -moz-background-size: cover;
  -o-background-size: cover;
  background-size: cover;
}

Referencia: How can I resize an image so it fits the entire window?

Scroll to Top