css background学习

来源:互联网 发布:个人音乐网站程序源码 编辑:程序博客网 时间:2024/05/22 03:44

background中背景单词

background-color: 设置颜色作为对象背景颜色
background-image :设置图片作为背景图片

background-repeat :设置背景平铺重复方向

background-attachment 设置或检索背景图像是随对象内容滚动还是固定的。
background-position 设置或检索对象的背景图像位置。

使用方法

Background背景样式的值是复合属性值组合,也就是背景单词的值可以跟多个属性值,值与值之间使用一个空格间隔链接上即可。
如:
background:#000 url(图片地址) no-repeat left top


background-attachment使用解析:
background-attachment:fixed; 背景固定
background-attachment:scroll css背景图片是随对象内容滚动

background-position : 5px 6px      div对象靠左距离5px,靠上距离6px


css背景资源地址


原创粉丝点击