0_5 CSS字体、文本和背景
1、字体样式
color 颜色
font-size 大小(三个单位)
font-family 字体族
2、文本样式
水平text-align
left(左对齐) right(右对齐) center(居中) justify(两端)
垂直vertical-align
baseline(基线对齐) top middle bottom
文本修饰text-decoration
none underline(下划线) line-through(删除线) over-line(上划线)
留白white-space
normal noswap(不换行) pre(保留空白)
3、背景
background-color:设置背景颜色
background-image:设置背景图片 background-image: url("./img/1.png");
background-repeat:设置背景重复 repeat repeat-x(沿x) repeat-y(沿y) no-repeat(不重复)
background-position: 偏移量 background-position: Xpx Ypx;
background-clip: 背景范围 border-box (默认值) padding-box content-box
background-origin 偏移量计算的原点 padding-box (内边距默认值) content-box border-box
background-size 设置背景图片的大小
cover 图片的比例不变,将元素铺满
contain 图片比例不变,将图片在元素中完整显示
background-attachment - 背景图片是否跟随元素移动
scroll 默认值 背景图片会跟随元素移动
fixed 背景会固定在页面中,不会随元素移动