鹊yr

导航

背景设置

背景
平铺
background­repeat:repeat:repeat­:可以取x横向 y纵向 none不平铺;
条件是背景小于标签尺寸,取值为:repeat默认值为xy方向上平铺,
背景图尺寸
background­size:auto图片保持原有的尺寸。
contain:等比例缩放撑满标签(图片大于标签尺寸)
cover:放大到适应的标签尺寸(图片小于标签,但是图片放大以后会失真)
百分比:标签的百分比;固定值:宽高相同的时候可以只给一个值;
渐变色
渐变色:background:linear­gradient(to top;颜色,颜色,颜色):线性渐变色
to top :从上到下依次变;
to bottom:从上到下依次变
45deg:45度角开始;
最少三个值,第一个是渐变方向,第二个是起始颜色,第三个是终止颜色。
background:repeating­linear­gradient():径向渐变色
背景图剪切
渲染区域是border­box的左上角
background­clip:border­box;padding­box;content­box;
图片背景根据内容平铺:background­origin:content­box;
background:url(图片位置) centertop位置 no­repeat;

posted on 2018-08-26 16:24  鹊yr  阅读(73)  评论(0编辑  收藏  举报