欢迎来到DIVCSS5查找CSS资料与学习DIV CSS布局技术!

 

CSS样式的冲突:

1.ID选择器 > 类选择器 > 标签选择器

2.行级样式表 > 内嵌样式表 > 外部样式表

外部样式表的ID选择器 > 内嵌样式表的标签选择器

原则: 就近原则

CSS的各种属性(掌握)

CSS中尺度单位的介绍

CSS的单位:

a. 绝对单位 1in=2.54cm=25.4mm=72pt=6pc , pt是点或者磅,pc是派卡

b. 相对单位:px, em(印刷单位相当于12个点), %(相对周围的文字)

*字体设置

p{

font-size:50px; /*字体大小*/

font-style:italic ; /*斜体*/

font-weight:bold; /*粗体*/

font-family:幼圆; /*字体类型*/

font-variant:small-caps; /*小写变大写*/

}

*文本设置

p{

letter-spacing:0.5cm ; /*字母间距*/

word-spacing:1cm; /*单词间距*/

text-align:center; /*在所包含容器的中间*/

text-decoration:overline; /*字体修饰 underline下划线 line-through中划线 overline上划线*/

text-transform:lowercase; /*单词字体大小写*/

color:red ;

}

*背景设置

body{

background-color:#ff99ff ; /*背景颜色*/

background-image:url(images/2.gif) ; /*背景图片*/

background-repeat: no-repeat; /*no-repeat不要平铺,repeat-x,横向平铺,repeat-y 纵向平铺*/

background-position:center right; /*背景位置*/

background-attachment: scroll ; /*背景的移动 ,fixed跟着滚动条一起移动,scroll 不动*/

}

*列表设置

ul li{

list-style:none; /*列表前样式*/

list-style-image:url(images/2.gif) ; /*列表项前图片*/

margin-left:80px;

}

*盒子模型(border margin padding)

padding:是内容到边的距离

border: 是边的粗细

margin:是控件到控件的距离

*定位设置(position,float,clear,z-index)

#d{

position: absolute; /*

1.绝对定位: 定义横纵坐标 .脱离了本身的顺序流

2.相对定位: 相对的是自己在顺序流中原来的位置

*/

left:100px; /*横坐标*/

top:100px; /*纵坐标*/

border:1px solid red ;

width:100px;

height:100px;

background-color:#ff66ff;

}

#d1{

position: relative; /*相对位置*/

left:100px;

top:100px;

border:1px solid green ;

width:100px;

height:100px;

background-color:#339900;

}

span{

position: relative;

left:20px;

top:20px;

}

z-index:值任意,值越大离我们越近

float : 浮动

overflow: 超出范围怎么办

鼠标样式设置(cursor)

如需转载,请注明文章出处和来源网址:http://www.divcss5.com/rumen/r39185.shtml