css的基础样式第一节

1.css背景
background-attachment 背景图像是否固定或者随着页面的其余部分滚动
background-color 设置元素的背景颜色
background-image 把图片设置为背景
background-position 设置背景图片的起始位置
background-repeat 设置背景图片是否及如何重复

2.css背景图片
1.background-image属性 设置背景图片

2.background-repeat属性 设置图片是否可重复
属性值:
no-repeat不能重复
repeat 可重复
repeat-x x轴重复
repeat-y y轴重复

3.background-position 设置图片的起始位置
属性值:
left center top bottom right

4.background-attachment 声明图像是否随页面滚动而移动
属性值:
scroll 默认值 背景图像随页面其余部分滚动而移动
fixed 不移动
inherit 从父元素继承background-attachment属性的设置

3.css3背景
background-size规定背景图片尺寸
background-origin 规定背景图片的定位区域
background-clip 规定背景的绘制区域

4.css样式文本
color 文本颜色
direction 文本方向
line-height 行高
letter-spacing 字符间距
text-align 对齐元素中的文本
text-decoration 向文本添加修饰
text-indent 缩进元素中文本的首行
text-transform 元素中的字母
unicode-bidi 设置文本方向
white-space 元素中空白的处理方式
word-spacing 字间距

注意
background-image:url属性设置背景图片时可能会出现路径错误
这里要使用的路径为相对路径,绝对路径不可以,在实际项目中很少使用绝对路径。

绝对路径:D:\YdPro\css学习\第四节:css基本样式二\css列表项图片\image\img1.jpg 这是绝对路径,在外部样式表中很容易查找不到.
相对路径:这里的相对路径是指相对于css文件来说. 具体就是 …\image\img1.jpg.
具体问题详见https://blog.csdn.net/strenghthen/article/details/52446587

https://blog.csdn.net/strenghthen/article/details/52446587

猜你喜欢

转载自blog.csdn.net/YdPro_/article/details/83508064