Div фон не красит весь Div - PullRequest
       21

Div фон не красит весь Div

0 голосов
/ 07 февраля 2019

У меня есть следующий код:

https://codesandbox.io/s/yv983q28xx

Источник:

<html>
<head>
<title>Testing on IE 11</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<style type="text/css">
body {
  margin: 0;
  padding: 0;
  background-color: #d6ffbb;
}
.page-container {
  padding: 10px;
}
footer {
  text-align: justify;
  font-family: Arial;
  font-size: 14px;
  letter-spacing: normal;
  padding: 20px;
  color: #fff;
  background: url("https://i.ibb.co/hYXDL2N/pattern-dark.jpg") top center
    repeat;
}
/* BEGIN OF CODE BLOCK FOR STICKY FOOTER */
body {
  display: -webkit-box !important;
  display: -ms-flexbox !important;
  display: flex !important;
  height: 100%;
  -webkit-box-orient: vertical;
  -webkit-box-direction: normal;
  -ms-flex-direction: column;
  flex-direction: column;
}
.page-container {
  -webkit-box-flex: 1;
  -ms-flex: 1 0 auto;
  flex: 1 0 auto;
}
/* END OF CODE BLOCK FOR STICKY FOOTER */
</style>
</head>

<body>
  <div class="page-container">
    hello world<br />
    hello world<br />
    hello world<br />
    hello world<br />
    hello world<br />
    hello world<br />
    hello world<br />
    hello world<br />
    hello world<br />
    hello world<br />
    hello world<br />
    hello world<br />
    hello world<br />
    hello world<br />
    hello world<br />
  </div>
  <footer>
    <p>
      Lorem Ipsum is simply dummy text of the printing and typesetting
      industry. Lorem Ipsum has been the industry's standard dummy text ever
      since the 1500s, when an unknown printer took a galley of type and
      scrambled it to make a type specimen book. It has survived not only five
      centuries, but also the leap into electronic typesetting, remaining
      essentially unchanged. It was popularised in the 1960s with the release
      of Letraset sheets containing Lorem Ipsum passages, and more recently
      with desktop publishing software like Aldus PageMaker including versions
      of Lorem Ipsum. Lorem Ipsum is simply dummy text of the printing and
      typesetting industry. Lorem Ipsum has been the industry's standard dummy
      text ever since the 1500s, when an unknown printer took a galley of type
      and scrambled it to make a type specimen book. It has survived not only
      five centuries, but also the leap into electronic typesetting, remaining
      essentially unchanged. It was popularised in the 1960s with the release
      of Letraset sheets containing Lorem Ipsum passages, and more recently
      with desktop publishing software like Aldus PageMaker including versions
      of Lorem Ipsum. Lorem Ipsum is simply dummy text of the printing and
      typesetting industry. Lorem Ipsum has been the industry's standard dummy
      text ever since the 1500s, when an unknown printer took a galley of type
      and scrambled it to make a type specimen book. It has survived not only
      five centuries, but also the leap into electronic typesetting, remaining
      essentially unchanged. It was popularised in the 1960s with the release
      of Letraset sheets containing Lorem Ipsum passages, and more recently
      with desktop publishing software like Aldus PageMaker including versions
      of Lorem Ipsum. Lorem Ipsum is simply dummy text of the printing and
      typesetting industry.
    </p>
    <p>
      Lorem Ipsum is simply dummy text of the printing and typesetting
      industry. Lorem Ipsum has been the industry's standard dummy text ever
      since the 1500s, when an unknown printer took a galley of type and
      scrambled it to make a type specimen book. It has survived not only five
      centuries, but also the leap into electronic typesetting, remaining
      essentially unchanged. It was popularised in the 1960s with the release
      of Letraset sheets containing Lorem Ipsum passages, and more recently
      with desktop publishing software like Aldus PageMaker including versions
      of Lorem Ipsum. Lorem Ipsum is simply dummy text of the printing and
      typesetting industry. Lorem Ipsum has been the industry's standard dummy
      text ever since the 1500s, when an unknown printer took a galley of type
      and scrambled it to make a type specimen book. It has survived not only
      five centuries, but also the leap into electronic typesetting, remaining
      essentially unchanged. It was popularised in the 1960s with the release
      of Letraset sheets containing Lorem Ipsum passages, and more recently
      with desktop publishing software like Aldus PageMaker including versions
      of Lorem Ipsum.
    </p>
  </footer>
</body>
</html>

Демонстрация: https://yv983q28xx.codesandbox.io/

Этот код работает нормально: {Chrome, Firefox, Edge}.

Но при работе на IE11 я получаю следующее поведение:

Прокрутка вверх : scrolled to top

Прокрутка вниз (рисование до конца предыдущего изображения): scrolled to bottom

Как вы видите, фон div не рисует весь div при прокрутке вниз.

Важно: это реализация sticky-footer, поэтому необходимо, чтобы когда выУменьшить нижний колонтитул, приклеить его к нижней части screen / viewport.

Есть идеи, как решить эту проблему на IE11, не затрагивая другие браузеры?

Если возможно, пожалуйста, раскошелитьсяcodesandbox.io и вставьте сюда ссылку с вашим решением.

Спасибо!

Ответы [ 2 ]

0 голосов
/ 08 февраля 2019

Применить flex: 0 0 auto; к нижнему колонтитулу.

enter image description here

0 голосов
/ 07 февраля 2019

Попробуйте указать идентификатор нижнего колонтитула и добавьте в него этот фрагмент кода

background-attachment: fixed;
background-position: center center;
background-size: cover;
...