背景属性
- 背景图片:
background-image:url(图片路径1),url(图片路径2); background-repeat:no-repeat,repeat;
背景图的展现方式(round平铺,repeat-x水平方向重复、repeat-y垂直方向重复,stretch拉伸)。
当有两张图片时需要设置图片的位置background-position:right bottom,left top;
- 背景图大小:
background-size:20px 60px;
- 背景定位:
background-position:10px 20px;
表示图片左上角距离上边距10px、距离左边距20px。 - 背景图在盒子内的位置:
background-origin:content-box;
在内容边框上background-origin:padding-box;
在内边距上background-origin:border-box;
在盒子边框上
- 背景图的绘制区域:
background-clip:content-box;
只绘制内容的背景background-clip:padding-box;
只绘制内边距的背景background-clip:border-box;
只绘制盒子边框的背景