想做出效果如下的頁(yè)面:
效果圖
html代碼入下
<!doctype html>
<html>
<head>
<meta charset="UTF-8"/>
<title>管理員列表</title>
<link rel="stylesheet" type="text/css" href="admin_list.css">
<style type="text/css"></style>
</head>
<body>
<!-- logo區(qū)域 -->
<div id="logo">
<img src="../img/logo.png"/>
<a href="#">[退出]</a>
</div>
<!-- 導(dǎo)航區(qū)域 -->
<div id="nav">
<ul class="menu">
<li><a href="#" id="index"><span>首頁(yè)</span></a></li>
<li><a href="#" id="role"><span>角色</span></a></li>
<li><a href="#" id="admin"><span>管理員</span></a></li>
<li><a href="#" id="fee"><span>資費(fèi)管理</span></a></li>
<li><a href="#" id="account"><span>賬戶賬號(hào)</span></a></li>
<li><a href="#" id="service"><span>業(yè)務(wù)賬號(hào)</span></a></li>
<li><a href="#" id="bill"><span>賬單管理</span></a></li>
<li><a href="#" id="report"><span>報(bào)表</span></a></li>
<li><a href="#" id="info"><span>個(gè)人信息</span></a></li>
<li><a href="#" id="pwd"><span>修改密碼</span></a></li>
</ul>
</div>
<!-- 內(nèi)容區(qū)域 -->
<div id="content">
<!-- 1诈乒、漸變條 -->
<!-- 2涣旨、核心區(qū) -->
<div id=main>
<!-- 操作區(qū) -->
<div id="operate">
<input type="button" value="增加"/>
</div>
<!-- 數(shù)據(jù)區(qū) -->
<div id="data">
<table>
<thead>
<tr>
<th><input type="checkbox"/>全選</th>
<th>管理員ID</th>
<th>姓名</th>
<th>角色</th>
<th>操作</th>
</tr>
</thead>
<tbody>
<tr>
<td><input type="checkbox"/></td>
<td>1</td>
<td>唐僧</td>
<td>法師勿她、牧師、術(shù)士</td>
<td>
<input type="button" value="修改" class="modify"/>
<input type="button" value="刪除" class="delete"/>
</td>
</tr>
<tr>
<td><input type="checkbox"/></td>
<td>2</td>
<td>孫悟空</td>
<td>法師逃贝、牧師脯倚、術(shù)士</td>
<td>
<input type="button" value="修改" class="modify"/>
<input type="button" value="刪除" class="delete"/>
</td>
</tr>
<tr>
<td><input type="checkbox"/></td>
<td>3</td>
<td>豬八戒</td>
<td>法師纲酗、牧師脚猾、術(shù)士</td>
<td>
<input type="button" value="修改" class="modify"/>
<input type="button" value="刪除" class="delete"/>
</td>
</tr>
<tr>
<td><input type="checkbox"/></td>
<td>4</td>
<td>沙僧</td>
<td>法師、牧師抡草、術(shù)士</td>
<td>
<input type="button" value="修改" class="modify"/>
<input type="button" value="刪除" class="delete"/>
</td>
</tr>
</tbody>
</table>
</div>
<!-- 分頁(yè) -->
<div id="page">
<a href="#">上一頁(yè)</a>
<a href="#">1</a>
<a href="#" class="current">2</a>
<a href="#">3</a>
<a href="#">4</a>
<a href="#">5</a>
<a href="#">下一頁(yè)</a>
</div>
<!-- 提示框 -->
<div id="msg">
<img src="../img/close.png"/>
<P>操作成功</P>
</div>
</div>
</div>
<!-- 版權(quán)區(qū)域 -->
<div id="copy">
<p><快來(lái)學(xué)JAVA這里有驚喜></p>
<p>程老師現(xiàn)場(chǎng)教學(xué)饰及,非常賣(mài)力</p>
</div>
</body>
</html>
CSS樣式入下:
/*1、設(shè)置頁(yè)面整體布局*/
/*a康震、因?yàn)閎ody默認(rèn)有外邊距燎含,上下左右出現(xiàn)縫隙*/
body{
margin:0px;
padding:0px;
}
/*b、同意設(shè)置div的邊框和外邊距
div水平居中*/
div{
border:1px solid #000;
margin:0px auto;
}
/*c签杈、逐個(gè)設(shè)置div的寬瘫镇,高,內(nèi)外邊距*/
#logo{
width:960px;
height:61px;
}
#nav{
width:100%;
height:91px;
}
#content{
width:100%;
height:410px;
padding-top:10px;
}
#copy{
width:960px;
height:50px;
}
/*設(shè)置內(nèi)容區(qū)里面的div 寬和高*/
#main{
width:950px;
height:390px;
border:5px solid #8ac1db;
}
#operate{
width:910px;
height:40px;
}
#data{
width:910px;
height:310px;
}
#page{
width:910px;
height:40px;
}
/*2答姥、設(shè)置背景圖片*/
body{
background-color:#0ea8d8;
}
/*設(shè)置logo背景圖片铣除,圖片大小和div一致,不需要設(shè)置平鋪*/
#logo{
background-image:url("../img/top_bg.png")
}
/*設(shè)置其他區(qū)背景顏色*/
#nav{
background-color:#0488bb;
}
#main{
background-color:#e8f3f8;
}
/*設(shè)置內(nèi)容區(qū)頂部背景漸變圖*/
#content{
background:url("../img/content_bg.png") repeat-x top
}
/*3鹦付、格式化文本*/
body{
font-family:"微軟雅黑";
font-size:14px;
}
/*設(shè)置logo尚粘,版權(quán)區(qū)域的字體顏色*/
#logo,#copy{
/*超鏈接自身有默認(rèn)樣式(藍(lán)色) 優(yōu)先級(jí)大于logo,需要單獨(dú)設(shè)置*/
color:#fff;
}
#logo{
text-align:right;
line-height:60px;
}
/*給超鏈接設(shè)置外邊距*/
#logo a{
margin-right:40px;
/*設(shè)置字體和下劃線*/
color:#fff;
text-decoration: none;
}
#logo a:hover{
font-weight:bold;
}
/*設(shè)置版權(quán)區(qū)內(nèi)容樣式*/
#copy p{
text-align: center;
/*P段落有默認(rèn)的外邊距敲长,這里要把外邊距清除郎嫁,否則會(huì)越出*/
margin:0px;
line-height:25px;
}
/*設(shè)置表格*/
table{
border:1px solid #aaa;
width:910px;
background-color:#fff;
border-collapse: collapse;
}
/*行標(biāo)題*/
th{
border:1px solid #ccc;
background-color:#fbedce;
height:40px;
}
td{
border:1px solid #ccc;
text-align:center;
height:32px;
}
/*鼠標(biāo)懸停在數(shù)據(jù)行時(shí),改變背景顏色*/
tbody tr:hover{
background-color:#f7f9fd;
}
/*3設(shè)置修改按鈕樣式*/
.modify{
/*設(shè)置內(nèi)邊距祈噪,給圖片騰出位置*/
padding:5px 5px 5px 15px;
/*將圖片作為背景泽铛,不用平鋪*/
background:url(../img/modification.png) no-repeat left;
/*去邊框*/
border:0px;
}
.delete{
/*設(shè)置內(nèi)邊距,給圖片騰出位置*/
padding:5px 5px 5px 15px;
/*將圖片作為背景辑鲤,不用平鋪*/
background:url(../img/delete.png) no-repeat left;
/*去邊框*/
border:0px;
}
/*修改和刪除按鈕上增加圖片后盔腔,鼠標(biāo)懸停時(shí)不再是手形*/
tbody input:hover{
cursor:pointer;
}
/*設(shè)置操作區(qū)樣式*/
/*整體設(shè)置*/
#operate{
text-align:right;
line-height:40px;
}
/*給按鈕設(shè)置樣式*/
#operate input{
/*按鈕的高和寬要為背景圖片的大小*/
width:71px;
height:26px;
background:url("../img/btn_bg.png");
color:#fff;
border:0px;
}
/*設(shè)置分頁(yè)區(qū)*/
#page{
text-align:center;
line-height:40px;
}
#page a {
text-decoration: none;
color:#000;
padding:5px 10px;
border:1px solid #e8f3f8;
/*外邊距因?yàn)?lt;a>換行不需要設(shè)置*/
}
/*鼠標(biāo)懸停改變樣式,邊框和前景是色*/
#page a:hover{
border:1px solid #97b9c9;
color:#067db5
background-color:#cddde4;
}
/*設(shè)置當(dāng)前頁(yè)樣式*/
#page .current{
border:1px solid #97b9c9;
background-color:#fff;
}
/*5月褥、定位圖片 logo圖片*/
#logo img{
float:left;
}
/*依照main為基準(zhǔn)提示定位*/
#main{
position:relative;
}
#msg{
position:absolute;
left:250px;
top:100px;
border:1px solid #f68a8a;
width:400px;
height:50px;
/*設(shè)置內(nèi)邊距弛随,解決文本貼邊問(wèn)題
將左內(nèi)邊距設(shè)置為40,是為了放背景圖片*/
padding:10px 10px 10px 40px;
background:#fdecec url("../img/ok.png") no-repeat 10px 26px
}
/*將提示框中的X圖片移動(dòng)到右上角*/
#msg img{
float:right;
}
/*鼠標(biāo)懸停變成手形*/
#msg img:hover{
cursor: pointer;
}
/*設(shè)置導(dǎo)航區(qū)*/
ul,li{
border:0px solid red;
}
.menu{
width:960px;
margin:0px auto;
list-style-type:none;
}
.menu li{
width:68px;
height:77px;
margin:7px 14px;
float:left;
}
.menu a{
width:68px;
height:77px;
display:block;
}
.menu span{
display:none;
}
#index{
background-image:url("../img/index_out.png");
}
#index:hover{
background-image:url("../img/index_on.png");
}
#role{
background-image:url("../img/role_out.png");
}
#role:hover{
background-image:url("../img/role_on.png");
}
#admin{
background-image:url("../img/admin_out.png");
}
#admin:hover{
background-image:url("../img/admin_on.png");
}
#fee{
background-image:url("../img/fee_out.png");
}
#fee:hover{
background-image:url("../img/fee_on.png");
}
#account{
background-image:url("../img/account_out.png");
}
#account:hover{
background-image:url("../img/account_on.png");
}
#service{
background-image:url("../img/service_out.png");
}
#service:hover{
background-image:url("../img/service_on.png");
}
#bill{
background-image:url("../img/bill_out.png");
}
#bill:hover{
background-image:url("../img/bill_on.png");
}
#report{
background-image:url("../img/report_out.png");
}
#report:hover{
background-image:url("../img/report_on.png");
}
#info{
background-image:url("../img/information_out.png");
}
#info:hover{
background-image:url("../img/information_on.png");
}
#pwd{
background-image:url("../img/password_out.png");
}
#pwd:hover{
background-image:url("../img/password _on.png");
}