我目前正在建立一个网站,并要求我的页脚粘在页面的底部 - 我有点挣扎 - 下面是我的HTML和我的CSS的一个例子 - 如果页面很小,我需要页脚保持在底部但是如果它变得更大,就随着页面一起成长.HTML:
<div class="container">
<div class="main">
<!-- some content -->
</div>
</div>
<div class="clear"></div>
<div id="footer">
<div class="container">
<div class="footer_nav">
<h4>Site Map</h4>
<ul>
<li><a href="index.php">Home</a></li>
<li><a href="food.php">Example Page 1</a></li>
<li><a href="#">Example Page 2</a></li>
<li><a href="#">Example Page 3</a></li>
<li><a href="#">Contact</a></li>
</ul>
</div>
<div class="footer_copy">
<p>©<?php echo date('Y');?> Oliver Fletcher<br/>
All Rights Reserved</p>
<h4>Where I learnt...</h4>
<img src="images/accreditations.jpg" alt="Team Treehouse">
</div>
<div class="footer_social">
<a href="https://twitter.com/fletcher_oli" target="_blank"><img src="images/twitter.png" alt="Twitter"></a>
<a href="https://www.facebook.com/oli.fletcher" target="_blank"><img src="images/facebook.png" alt="Facebook"></a>
<a href="https://www.linkedin.com/e/fpf/183035612" target="_blank"><img src="images/linkedin.png" …Run Code Online (Sandbox Code Playgroud)