CSS学习笔记

1.div换行:display:block;float:left;DIV 默认是换行的
PS:设置不换行,后设置下一个DIV时时需要清楚该换行属性.clear{ clear:both}在html中调用div class='clear'

2.ul中li横向显示:设置ul的属性folat:left 以及li的属性设置为float:left

3.去掉li前的点:list_style:none

4.span自动换行:word-break:normal; width:250px; display:block; white-space:pre-wrap;word-wrap : break-word ;overflow: hidden ;

5.有时候会出现margin和padding属性设置无效的情况是没有设置float浮动属性

6.div固定在显示页面的某个位置(比如左上角):div{position:fixed;z-index:100;}

7.div固定显示在父控件的某个位置{padding: 0px;float: right;position: absolute;top: -15px; right: 0px;}或者{padding:0px;float:right;position:relative;top:-10px;z-index:1;}

posted @ 2014-10-16 15:27  hello_myworld  阅读(105)  评论(0编辑  收藏  举报