Show fixed banner at the bottom of the site

Asked

Viewed 581 times

0

I would like to show a fixed banner at the bottom of my site, but I want it to track the content of the site conforms by rolling the site to downloaded or up, I have already been able to show the banner, but I could not make it follow the page.

My code:

<div id='barra' style='position:relative; min-height: 100%; left:-02px; width:100%;'>

<iframe border='0' class='overlay2' frameborder='0' height='55' marginheight='0' marginwidth='0' scrolling='No' src='http://Publicidades.html' style='max-width: 630%; width: 100%;'/></div>

I tried to use this CSS but it didn’t work.

<style>

    /*Esconde a dive de classe Overlay caso seja identificado que o width Mobile maximo deseja igual ou menor que 980px*/
    @media only screen and (min-width: 980px){
        .overlay2 { display: none; }

    #barra { bottom: 0; display: block; height: 50px; position: relative; width: 100%; background: #000; }

</style>    

Please somebody help me!!

  • Do you want the footer to always be visible at the bottom of the screen? Try changing the position: relative; for position: fixed;, something like: https://fiddle.jshell.net/Lsn3t772/

1 answer

1

Hello, place the element with fixed position!

#barra { bottom: 0; left: 0; display: flex; justify-content: center; height: 50px; position: fixed; width: 100%; background: #000; }

In case any questions arise, leave it there!

  • Thank you very much! I did exactly what you told me, it worked!!

Browser other questions tagged

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