Używam próbki Boostrap do tworzenia lepkiej stopki dla strony internetowej za pomocą CSS, wszystko działa dobrze, stopka pozostaje na miejscu na dole strony w miarę zmiany rozmiaru strony. Na wielu stronach mam treść, która musi być wyświetlana praktycznie na całej stronie, z zakazem stopki. Sekcja zawartości strony musi więc być ustawiona na 100% wysokości, aby zawartość mogła z kolei zostać zwymiarowana do pełnej wysokości.Jak ustawić zawartość stopki Bootstrap w pełnej wysokości strony?
Here's a JSFiddle that demonstrates the problem.
Jak możemy zielony kontener div pełnej wysokości, a więc dotyka Góra strony na górze i na szczyt stopce na dole?
Dzięki!
<div id="wrap">
<!-- Begin page content -->
<div class="container">
<div class="page-header">
<h1>Sticky footer</h1>
</div>
<p class="lead">This is the sticky footer template taken from the Bootstrap web site.</p>
<p class="lead">How can we make this green .container div the full height of its parent #wrap div?</p>
</div>
<div id="push"></div>
</div>
<div id="footer">
<div class="container"></div>
</div>
#wrap .container {
background-color: lightgreen;
}
/* Sticky footer styles */
html, body {
height: 100%;
/* The html and body elements cannot have any padding or margin. */
}
/* Wrapper for page content to push down footer */
#wrap {
min-height: 100%;
height: auto !important;
height: 100%;
/* Negative indent footer by it's height */
margin: 0 auto -60px;
}
/* Set the fixed height of the footer here */
#push, #footer {
height: 60px;
}
#footer {
background-color: #f5f5f5;
}
http://v1.reinspire.net/blog/2005/10/11/css_vertical_stretch/ to martwy link. – Alex