学习记录6

背景

background-image:url(图片路径);

图片大,显示图片左上角

一样大,完整显示

元素大,平铺图片

一般情况会同时设置背景图片跟背景颜色  图片覆盖颜色

background-repeat 图片重复方式

repeat  no-repeat  repeat-x  repeat-y

图片默认在背景颜色的左上角

background-position 指定两个值来定位图片  只有一个值则默认加一个center

top  right  left  bottom  center

xpos ypos  指定两个偏移量  可以指定负值

background-attachment  是否随滚动条一起移动

scroll  fixed 一般设置给body   

猜你喜欢

转载自www.cnblogs.com/xihuanjiuquqiqang/p/10166463.html
今日推荐