一、文本样式
1、css文本属性
/*rgb(0%,100%,0%);数字:0~255;百分比:0%~100%; #00880a;十六进制*/
.p1{color: bisque;}
/* 设置字体排布 ,默认向左, left,center,right*/
.p2{text-align:center;}
/* 设置或删除文本的装饰 ,none,overline,line-through,underline*/
.p3{text-decoration:none;}
/* 设置字体的粗细,100-900,默认正常的字体粗细,但是比如说如果你设置900,
最粗的字体,但是如果你的系统没有这样粗的字体,依然会按照默认的样式显示。 */
.p4{font-weight: normal;}
/* 文字的行高 */
.p5{line-height: 200px;}
/* 文字阴影
text-shadow:水平偏移距离 垂直的偏移距离 模糊度 阴影的颜色 */
.p6{text-shadow:0px 0px 5px black;}
![](https://img-blog.csdnimg.cn/20200703114713356.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3FxXzM2ODAyMjE0,size_16,color_FFFFFF,t_70)
2、css字体属性
对font的定义参数必须按照如下的排列顺序。
font : font-style || font-variant ||
font-weight || font-size ||
line-height || font-family
例子:p { font: italic small-caps 600 12pts/18pts 宋体; }
font-style
p.normal {font-style:normal;} 正常
p.italic {font-style:italic;} 斜体
p.oblique {font-style:oblique;} 倾斜的文字
二、背景图
当使用简写属性时,属性值的顺序为::
background-color
background-image
background-repeat
background-attachment
background-position
background-image: url(img/bg-little.png);/*背景图*/
background-repeat: no-repeat; /*背景图只显示一张*/
background-position: bottom left;/*背景图定位*/
background-attachment: fixed;/*scroll 随着滚动出现 fixed保持在页面上*/
/* background-repeat:repeat; */ /*背景图无线重复铺满页面*/
/*background-repeat:repeat-x;*//*背景图 x轴 无线重复铺满页面*/
/*background-repeat:repeat-y;*//*背景图 y轴 无线重复铺满页面*/
/* background-color: rgb(255,0,0); *//*背景颜色*/