應(yīng)用WEB標(biāo)準(zhǔn)實(shí)例:列表頁面的制作
實(shí)例效果圖:

整體觀察思考:
在開始制作頁面前,我們首先要觀察圖的結(jié)構(gòu),考慮怎樣布局,布局對一個網(wǎng)站來說非常重要,他是整個體系的骨骼。
再看此圖
很經(jīng)典的三行兩列結(jié)構(gòu),分為四塊,TOP、RIGHT、LEFT、BOTTOM。如下圖
以上我們思考過整體的結(jié)構(gòu),接下來我們要考慮如何把思考出來的結(jié)構(gòu)變化成"骨骼"
如下圖(盒模型來分析)
制作流程:
主體制作 --> 細(xì)節(jié)制作
一、制作主體:
xhtml:
<div class="editorChoose">
<h1></h1>
<div class="edRight"> </div>
<div class="edLeft"> </div>
<div class="edBottom"></div>
</div>
css:
@import url("http://www.07art.com/public/public.css");
.editorChoose{width:591px;height:400px;border:1px solid #aaa;background:#fff;}
/*TOP內(nèi)容*/
.editorChoose h1{height:30px;line-height:30px;border-bottom:1px solid #aaa;text-align:center;font-weight:bold;color:#000;background:#efefef;}
/*LEFT內(nèi)容*/
.edLeft{float:left;width:142px;height:317px;border-right:1px solid #aaa;overflow:auto;}
/*RIGHT內(nèi)容*/
.edRight{float:right;width:448px;height:317px;overflow:auto;}
/*BOTTOM內(nèi)容*/
.edBottom{clear:both;padding-top:15px;height:35px;border-top:1px solid #aaa;text-align:center;background:#efefef;}
骨骼出來了,接下來我們該在骨骼上添加"血"遇"肉",這樣才算完整的.
二、細(xì)節(jié)制作:
(1) TOP制作
先來看一下TOP容器中的細(xì)節(jié)部分。
看上去這里很簡潔,文字居中,關(guān)閉按鈕居右并且距上8px、距右10px的距離。
考慮TOP的結(jié)構(gòu),關(guān)閉按鈕在右邊,那么我們就要給關(guān)閉按鈕一個右浮動(float:right;)。
注意:當(dāng)關(guān)閉按鈕要右浮動的時候,關(guān)閉按鈕放在文字前面。
相對應(yīng)的css
.editorChoose h1{height:30px;line-height:30px;border-bottom:1px solid #aaa;text-align:center;font-weight:bold;color:#000;background:#efefef;}/*文字居中*/
.editorChoose h1 img{float:right;margin:8px 10px 0px 0px;}/*圖片居右*/
(2) RIGHT制作
看一下RIGHT容器中的細(xì)節(jié)部分。
紅塊區(qū)域?yàn)橹貜?fù)區(qū)域,所以只做一塊,然后copy就可以.
<div>
<input name="checkbox" type="checkbox" value="" />
<img src="images/pic02.jpg" alt=""/>
</div>
相對應(yīng)的css
.edRight div{width:95px;padding:18px 0px 12px 10px;float:left;}
.edBottom{clear:both;padding-top:15px;height:35px;border-top:1px solid #aaa;text-align:center;background:#efefef;}
(3) LEFT制作
看一下RIGHT容器中的細(xì)節(jié)部分。
這是一個列表性質(zhì)的圖,首先就要考慮ul li。
h2 標(biāo)簽寫相冊“相冊列表”位置
ul 寫下面的列表,并用overflow:auto;來控制滾動條,
xhtml:
<h2><span>相冊列表</span></h2><ul>
<li><a href="#">我的一家幸福生活</a></li>
<li><a href="#">包身工是怎么死的?</a></li>
<li><a href="#">楊文你真是個混蛋!</a></li>
<li class="background"><a href="#">小白被拋棄</a></li>
<li><a href="#">我的一家幸福生活</a></li>
<li><a href="#">梔子花開</a></li>
<li><a href="#">我的野蠻女友</a></li>
<li><a href="#">藍(lán)色生死戀</a></li>
<li><a href="#">這該死的愛</a></li>
<li><a href="#">湖南大學(xué)</a></li>
<li><a href="#">新一佳</a></li>
<li><a href="#">新一佳</a></li>
<li><a href="#">新一佳</a></li>
<li><a href="#">新一佳</a></li>
<li><a href="#">新一佳</a></li>
</ul>
css:
.edLeft h2{padding:1px 1px 0px 1px;height:26px;border-bottom:1px solid #aaa;}
.edLeft h2 span{text-align:center;height:25px;background:#BFBDBD;color:#000;text-align:center;font-weight:bold;line-height:25px;display:block;}
.edLeft{float:left;width:142px;height:317px;border-right:1px solid #aaa;}
.edLeft ul{height:290px;overflow:auto;}
.edLeft li{height:27px;line-height:27px;border-bottom:1px solid #aaa;padding-left:10px;}
.edLeft li a{color:#000;}
.edLeft li a:link,.edLeft dd a:visited{text-decoration:none;}
.edLeft li a:hover{text-decoration:underline;}
.edLeft li.background{background:#ECEBEB;}
(4) BOTTOM制作
這里我把按鈕寫成input的形式
<input type="button" name="button" value="確 定"/> <input name="button" type="button" value="取 消"/>
相對應(yīng)的css
.edBottom input{width:37px;height:22px;color:#000;border:1px solid #555;background:#aaa;}
[Ctrl+A 全選 注:引入外部Js需再刷新一下頁面才能執(zhí)行]
相關(guān)文章
區(qū)分IE6,IE7,firefox的CSS hack
經(jīng)常網(wǎng)頁布局需要兼職多瀏覽器,所以下面的css hack可以用,但最好少用,不得不用才用2008-04-04當(dāng)ie7不認(rèn)!important之后 [布局的解決辦法]
當(dāng)ie7不認(rèn)!important之后 [布局的解決辦法]...2007-02-02做網(wǎng)頁字體大小參考 網(wǎng)頁中同字號字體的不同單位對比列表
做網(wǎng)頁字體大小參考 網(wǎng)頁中同字號字體的不同單位對比列表...2007-08-08firefox下rowspan+border+border-collapse的bug
好久沒有發(fā)相關(guān)瀏覽器的坑了。今天同事cy發(fā)現(xiàn),在firefox里rowspan不生效...2010-02-02div+css實(shí)現(xiàn)的滑動門,簡潔,新手上路 (小鴿子系列)
div+css實(shí)現(xiàn)的滑動門,簡潔,新手上路 (小鴿子系列)...2007-03-03