CSS常用样式表

常用的文本属性

1.【line-height 】 设置行号,常用25px、28px  ;例:line-height="25px"     布局多行文本

2.【text-align】 设置对齐方式,常用取值为left、right、center ;例: text-align="center"  各种元素对齐

3.【letter-spacing】 设置字符间距,常用取值为 3px、8px  ; 例:letter-spacing="5px"  加大字符间间隔

4.【text-decoration】 设置文本修饰,常用取值underline、none  ;  例:text-decoration="underline"  加中划线、下划线等

5.【white-space】 规定如何处理空白,例如规定是否换行等,常用取值为nowrap(不换行); 例:white-space="nowrap"  文本溢出时不断行

常用的字体属性

1.【font】 在一个声明中设置字体的所有样式属性   例;font:bold 12px 宋体   常用语字体样式的缩写

2.【font-family】 定义字体类型  例:font-family:宋体  定义字体样式

3.【font-size】 定义字体大小  例:font-size:12px  定义字体样式

4.【font-weight】 定义字体的粗细 例:font-weight:bold 定义字体样式

常用的背景属性

1【background】 在一个生命中设置所有的背景属性 例:background:#ccc url(images/bg.png) repeat-x 20px -100px

2.【background-color】 设置背景颜色  例: background-color:#ccc

3.【background-image】设置背景图片 例:background-image:url(images/bg.png)

4.【background-repeat】设置背景的平铺方式  例:background-repeat:no-repeat

5.【background-position】设置背景出现的初始位置  例:background-position: 20px-100px

background-repeat属性对应的取值.【background-repeat】

1.【repeat】 横纵向都平铺,不填时的默认值   【应用场景】小方块图平铺构建整体背景

2.【repeat-x】 横向平铺  【应用场景】细长小图实现渐变效果

3.【repeat-y】 纵向平铺 【应用场景】 小图背景实现特殊边框

4.【no-repeat】 背景图不重复平铺 【应用场景】 大图做背景或使用偏移量控制

常用的类表类型图标

1.【none】 去掉修饰符号 list-style:none   

2.【disc】 是新圆  list-style:disc

3.【circle】 空心圆 list-style:circle

4.【square】 实心正方形  list-style:square

5.【decimal】 数字 list-style:decimal

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章