Нижний край с различной высотой содержимого - PullRequest
2 голосов
/ 19 октября 2010

У меня есть проблема, которую я пытался решить, но без какого-либо прогресса.

Это сводка моего кода:

body {
  background-image: url('img/bg_Body.gif');
  margin: 0px 0px 0px 0px;
}

#container {
  position: relative;
  width: 880px;
  margin-left: auto;
  margin-right: auto;
  top: 0px;
  min-height: 100%;
}

#content {
  position: absolute;
  top: 0px;
  left: 0px;
  background-image: url('img/faux_tile.png');
  min-height: 200px;
  padding-top: 105px;
  padding-right: 80px;
  min-width: 400px;
  padding-left: 80px;
  padding-bottom: 110px;
}
<div id="container">
  <div id="content">
    Some content here (Varying height)
  </div>
</div>

Как добавить поле между содержимым и концом страницы?

faux_tile.png охватывает конецстраница, я хочу поле между концом страницы и faux_tile.png, который является небольшим полем, показывая bg_Body.gif.

Ответы [ 2 ]

0 голосов
/ 19 октября 2010

попробуйте это:

#content {
    position: absolute;
    top: 0px;
    left: 0px;
    right:0;
    bottom:20px; /*this should give you 20px margin at the bottom*/
    background-image: url('img/faux_tile.png');
    min-height: 200px;
    padding-top: 105px;
    padding-right: 80px;
    min-width: 400px;
    padding-left: 80px;
    padding-bottom: 110px;
}

другой способ мог бы дать #container a min-height менее 100%

0 голосов
/ 19 октября 2010

Вы могли бы дать body a margin-bottom.

То, что должно вызывать маржу, даже если ваш контейнер position: absolute.

...