Put footer floating on another div

Asked

Viewed 145 times

0

I have the following html structure:

<body>
    <div id="gmap"></div>
    <footer>
    //conteudo do footer
    </footer>
</body>

I want to put the div Gmaps occupying the whole screen and the footer floating on it, currently this way:

Uma div sobre a outra

Current css this:

#gmap{
    z-index: 1;
    width:100%;
    height:80vh;
}
footer{
    z-index: 2;
}
  • You want the footer over the #gmap?

  • I don’t know if this is it, but your css selector has the wrong name. See: "Gmap"

  • you will leave the Gmaps fixed on 100% of the screen and the footer on it below, but fixed also?

  • 1

    already managed to add width:100%; position: Fixed; bottom: 0; in footer

1 answer

2


If you want the footer is above the div with id #gmaps, recommend using these css in footer

footer{
width:100%;
position: fixed;
bottom: 0;
}

With this code, you can put the footer above

Browser other questions tagged

You are not signed in. Login or sign up in order to post.