<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>代碼管理系統</title>
<link rel="stylesheet" href="css/style.css"/>
<link rel="stylesheet" href="css/icon.css"/>
<script src="js/jquery-1.10.1.js"></script>
<script src="js/icon.js"></script>
<script src="js/sc-js.js"></script>
</head>
<body>
<div id="wapper">
<div id="nofooter">
<div id="header">
<div id="header-content">
<div class="logo"><a href="#"><img src="img/logo.png"/></a></div>
<div class="header-title">
<a href="#">
<h1><span class="green">代碼</span>管理系統</h1>
<h4><i>Sample Code Manage System</i></h4>
</a>
</div>
<div id="login-bar">
<div id="login-msg">
<span class="icon-cancel-circle light_pink"></span>
<span class="light_pink"> 用戶名不可為空!</span>
</div>
<form action="#">
<!-- <label class="white">用戶名:</label> --><input type="text" name="username" placeholder="用戶名"/>
<!-- <label class="white">密碼:</label> --><input type="password" name="password" placeholder="密碼"/>
<a class="submit_btn" href="#"><span class="icon-enter"></span> 登錄</a><a class="normal_btn" href="register.html"><span class="icon-user3"></span> 注冊</a>
</form>
</div>
</div>
</div>
<div id="content">
<div id="side">
<ul>
<li><a href="index.html"><span class="icon-download"></span> 代碼下載</a></li>
<li><a href="admin.html"><span class="icon-profile"></span> 代碼管理</a></li>
<li><a href="upload.html"><span class="icon-upload"></span> 代碼上傳</a></li>
</ul>
</div>
<div id="main">
<div class="main_error">
<span class="icon-sad"></span><br/><br/>
<h1>請求的資源未找到!</h1>
</div>
</div>
</div>
</div>
<div id="footer">
<h4>©2014 [email protected] Copy Right Reserved</h4>
</div>
</div>
</body>
</html>
>
css文件(關鍵部分):
#nofooter{padding-bottom: 70px; /* 不至被footer蓋住 */}
請問hearer前面的nofooter有什麼作用?為什麼說如果不加padding-bottom: 70px就會被蓋住?
foot和內容也分開羅。。。結構就是下面這種。。目測你的總容器wapper是relative定位,footer是absolute定位在最下面,而且高度是70,增加padding-bottom就是為了容納70px高度的fotter,自己用開發工具看下dom結構和作用的css不就清楚了
<div id="nofooter">
</div>
<div id="footer">
</div>