css背景,文本,字体

一:背景

1.background-color,为元素设置背景色。p{ background-color:gray; }//默认为透明也可以用#00000十六进制还可以用rgb来表示。

2.background-image,背景图片默认null,body{ background-image: url("./img/1.jpg");}.//可以将背景图片放在任意位置。

3.background-repeat,背景重复/平铺,body{ background-image: url("./img/1.jpg"); background-repeat:repeat/repeat-x/repeat-y/no=repeat}.//参数分别为:水平和垂直方向都平铺,水平平铺,垂直平铺,不平铺。

4.background-position,背景图片定位,body{ background-image: url("./img/1.jpg");  background-position:center/top/right/left/bottom;}.

5.background-attachment,背景关联/图片是否随之滚动。body{ background-image: url("./img/1.jpg"); background-attachment: fixed/scroll}.//参数:固定,默认为随内容滚动


二:文本

1.text-indent,文本缩进。p{ text-indent: 10em;}

2.text-align,文本对齐。p{ text-align:left/center/right}

3. word-spacing,字间距,word-spacing:30px;//只对字母有效,中文无效。

4.letter-spacing,字母间距,letter-spacing:20px;//对任意字符有效。

5.text-transform, 字符转换,text-transform:none|capitalize|uppercase|lowercase;//默认未发生转换/每个单词首字母转为大写/转为大写/转为小写。

6.text-decoration,文本装饰,text-decoration:none|underline|overline|lin-through|blink;


三:字体

1.font-family,字体设置,应用到body中。

2.font-style,字体风格,参数normal/italic/oblique;默认/斜体/斜体

3.font-weigth,粗体,参数normal/bolder...;默认/粗体

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值