用ul li 寫網(wǎng)站的footer

效果圖

從最簡(jiǎn)單的開始寫,今天使用UL LI標(biāo)簽寫footer頁(yè)面,主要的思想是用ul li寫三個(gè)列表,浮動(dòng),然后在每個(gè)li標(biāo)簽里面再嵌套一個(gè)ul li標(biāo)簽,這里我發(fā)現(xiàn)了一個(gè)現(xiàn)象,當(dāng)我把每一個(gè)li標(biāo)簽設(shè)置了高度之后,整一個(gè)大的ul標(biāo)簽就也跟著有高度了,然后這個(gè)浮動(dòng)的大的ul標(biāo)簽的后端沒有設(shè)置清除浮動(dòng)的時(shí)候,居然也不會(huì)影響整個(gè)頁(yè)面的布局,這個(gè)現(xiàn)象值得注意!前提是你這個(gè)浮動(dòng)的元素的子元素有明確高度的情況下。

代碼如下


CSS:

@charset "utf-8";

*{

margin: 0;

padding: 0;

color: #bababa;

font-size: 14px;

}

ul li{

list-style: none;

}

a{

text-decoration: none;

}

.clearfix{

clear: both;

}

.wt1170{

width: 1170px;

margin: 0 auto;

}

.footer{

background: #373939;

height: 300px;

}

.wt1170 ul{

margin-top: 50px;

}

.wt1170 li{

display: block;

}

.wt1170 .l1{

width: 270px;

padding-bottom: 10px;

border-bottom: 1px solid #fff;

font-size: 22px;

margin-top: 0;

}

.wt1170 .u1,.wt1170 .u2{

margin-right: 180px;

}

.u1,.u2,.u3{

float: left;

}

.u1 li,.u2 li,.u3 li{

/*width: 270px;*/

margin-top: 12px;

}

.l1-01,.l1-02,.l1-03{

height: 32px;

line-height: 32px;

}

.footer-bottom{

height: 30px;

line-height: 30px;

background: #000000;

text-align: center;

}

.l1-01{

padding-left: 40px;

background:url(../img/001.png) no-repeat;

}

.l1-02{

padding-left: 40px;

background:url(../img/002.png) no-repeat;

}

.l1-03{

padding-left: 40px;

background:url(../img/003.png) no-repeat;

}

.l2{

height: 16px;

line-height: 16px;

}

.l2:before{

content: url(../img/icon-before.png);

}

最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請(qǐng)聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時(shí)請(qǐng)結(jié)合常識(shí)與多方信息審慎甄別。
平臺(tái)聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡(jiǎn)書系信息發(fā)布平臺(tái),僅提供信息存儲(chǔ)服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

友情鏈接更多精彩內(nèi)容