您的位置:首页 > Web前端 > CSS

css background学习

2017-07-06 17:23 162 查看
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背景资源地址
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  css背景