How do you always leave Footer at the end of the page?

Asked

Viewed 6,249 times

1

I leave this below only for information even... CSS of my page:

body{
   margin: 0 auto;
   padding: 0;
   min-height:100%;
   position:relative;

}
head {
    display: none;
    position: relative;
    min-height: 100%;
}
html{
    height: 100%;

}
div {
    display: block;

}
#container{
    position: relative;
    min-height: 100%;

}
#IGN_SCT{
    height: 100%;
}
.corpo{
    position: relative;
    width: 1024px;
    left: 50%;
    margin-left: -512px;
    min-height:2100px;

}

Gostaria que ficasse fixo na parte de baixo da pagina independente do conteúdo acima dela

I would like it to be fixed at the bottom of the page regardless of the content above it

2 answers

1

<footer></footer>

It has semantic properties to be used as a footer.

With one more thing:

footer{
width: 100%;
height: 50px;
margin: auto;
bottom: 0;
}

And a:

position: fixed;

If you want to let it always appear on the screen.

  • Do you? What would be these properties?

  • put the element in your html and check in the developer tool Ué

  • In my opinion it is good semantically and great for search engines, for facilitating understanding.

  • That’s for sure. It’s just that in the way that I initially said that the element could already be fixed by itself, without relying on CSS.

  • I’m sorry, I wrote it quickly and without thinking, but that’s not what I meant.

0

If you want it fixed at the bottom of the page..

footer {
    position: fixed;
    bottom: 0;
}

If you want at the bottom of the page but not fixed...

 footer {
    position: relative;
    bottom: 0;
}

recommend studying flex-box.. are properties that help and a lot in positioning the elements on the page through CSS3.. and still does it all responsive! BS: I haven’t tested the codes...

Browser other questions tagged

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