用ul li 写网站的footer

效果图

从最简单的开始写,今天使用UL LI标签写footer页面,主要的思想是用ul li写三个列表,浮动,然后在每个li标签里面再嵌套一个ul li标签,这里我发现了一个现象,当我把每一个li标签设置了高度之后,整一个大的ul标签就也跟着有高度了,然后这个浮动的大的ul标签的后端没有设置清除浮动的时候,居然也不会影响整个页面的布局,这个现象值得注意!前提是你这个浮动的元素的子元素有明确高度的情况下。

代码如下


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);

}

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容