css复习2

91 阅读1分钟

背景属性:背景色:background-color,背景图:background-image,背景图平铺方式:background-repeat,背景图位置:background-position,背景图缩放:background-size, 背景图固定:background-attachment,背景复合属性:background

背景图::属性值:url

 div {
   width:400px;
   height:400px;
   
   background-image:url(./image/1.png)
 }  

背景图平铺方式:background-repeat:no-repeat ,background-repeat:repeat-x,background-repeat:repeat-y

背景图位置:水平,垂直。右下:background-position:right bottom;

背景图缩放:属性值:关键字:cover,contain.百分比.图片

背景图固定:让背景不随着元素的内容滚动

body {
 background-image:url();
 background-repeat:no-repeat;
 
 background-attachment: fixed;
}  

转换显示模式:display。属性值:block 块级.lnline-block行内块lnline行内