Не получается прижать футер к низу экрана

Не поможете с футером? Он "отклеивается", может быть, дело в том , что данный код некроссбраузерный?

#footer {
  width: 100%;
  height: 50px;
  background: #000;
  text-align: center;
}

#footer span {
  font-size: 18px;
  color: #fff;
}
<div id="footer"><span>текст футера</span></div>


Ответы (2 шт):

Автор решения: Denis I

Я так понимаю, вам его прижать вниз надо?

#footer{
position:absolute;
bottom:0;
width:100%;
height:50px;
background: #000;
text-align: center; 
}
→ Ссылка
Автор решения: Firsov36

Можно флексом.

html, body {
  height: 100%;
}

.wrapper {
  height: 100%;
  
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
}

header, section, footer {
  border: 1px solid #ccc;
}

.wrapper > section {
  flex: 1;
}
<div class="wrapper">
  <header>header</header>
  <section>section</section>
  <footer>footer</footer>
</div>

→ Ссылка