其他分享
首页 > 其他分享> > 前端第五波

前端第五波

作者:互联网

前端第五波

背景

background-color: red;//背景的颜色

background-image: url(x.jpg);//背景图片

当添加背景图片时默认为左上角对齐;

background-repeat: no-repeat;//背景图片上是否平铺

background-position: x, y;//规定图片的位置

1.x,y可以为方位名词如:center,top,bottom,left,right ;

2.当只写一个方位名词时另一个方位名词默认为center;

3.x,y可以为像素值且必须有顺序,x在前,y在后;

background-attachment:fixed;//默认为滚动,fixed:设定为固定在页面上,不滚动

background-rgba(0,0,0,0);//分别对应红(red),绿(green),蓝(blue),透明度(alpha值在(0~1))

 

 

标签:方位,名词,前端,默认,第五,red,background,背景图片
来源: https://blog.csdn.net/Kong_xiang/article/details/90137586