背景元素
2018-08-04 14:50 w**2 阅读(194) 评论(0) 收藏 举报 background-image:url(“路径”);背景图
background-repeat:no-repeat;不平铺
background-repeat:repeat-x;横向平铺
background-repeat:repeat-y;纵向平铺
background-repeat:repeat;平铺
background-position:left top;
background-position:center bottom;
background-position:center center;
background-position:20px 10px;距离左边20px,距离上部10px(x轴y轴)
background-size:cover;
background-size:contain;
background-size:100% 100%;宽高
background-size:100%;一般是100%
background-attachment:fixed;控制背景图固定不变
background:pink url(“ ”) no repeat center center;
背景颜色 背景图地址 平铺方式 可选
background-size是css3才有的,如果浏览器能识别到,可加上/100%,如不能就分开写
浙公网安备 33010602011771号