css背景
Css背景
背景颜色:background-color:black;
背景图片:background-imag:url(图片地址);
背景平铺
不平铺:background-repeat:no-repeat;
横向平铺:background-repeat: repeat-x;
纵向平铺:background-repeat: repeat-y;
背景位置
background-position:0 0;
前面是x轴后面是y轴,x和y轴可以设置方位名词也可以设置具体单位
如果是设置两个方位名词,顺序是没有关系
如果只设置一的值另一个就是水平居中
背景附着:
背景固定:background-attachment: fixed;
背景滚动:background-attachment:scroll;
背景简写:背景颜色,背景位置,背景平铺,背景附着,背景位置中间用空格隔开
background:#fff url(图片位置) no- repeat left top;
背景透明
background:rgba(0,0,0,0.3)
css背景,背景位置,背景平铺,背景拉伸,背景附着
最新推荐文章于 2024-04-19 09:39:59 发布