Web前端学习—基础篇(16)_如何给设置背景图

更新时间:2023-07-31 19:08:36 阅读: 评论:0

Web前端学习—基础篇(16)_如何给设置背景图
当然可以的英文前端学习——基础篇
四、CSS学习
涛字组词4.6、背景
作⽤在内容、内填充、边框
4.6.1、背景颜⾊ background-color属性
默认背景颜⾊透明⾊transparent
属性值可以是:关键词、⼗六进制⾊值、rgb颜⾊模式、rgba颜⾊模式
4.6.2、背景图⽚ background-image属性
语法:
background-image: url(图⽚地址);
车祸赔偿协议书
background-image: none; 没有背景图⽚,默认值
特性:
背景图⽚不占位
默认在⽔平⽅向和垂直⽅向重复、平铺,铺满整个盒⼦
背景图是⽹页的装饰,起美化作⽤
写在样式中(不会被搜索引擎搜索到)
4.6.3、背景图是否重复 background-repeat属性
background-repeat: repeat; 默认值背景图在⽔平⽅向和垂直⽅向重复
借物抒情的诗句background-repeat: no-repeat; 不重复
background-repeat: repeat-x; 沿着⽔平⽅向重复
background-repeat: repeat-y; 沿着垂直⽅向重复
固定资产清查
4.6.4、背景图定位属性 background-position属性
语法:
background-position: x y;
属性值:
关键词:left|center|right top|center|bottom 如果有1个关键词,另⼀个关键词默认为center
酸包菜数值:px|% 如果是两个值,第⼀个表⽰⽔平⽅向,第⼆个表⽰垂直⽅向;如果只有⼀个值,表⽰⽔平⽅向,垂直⽅向居中(50%)
纵死侠骨香4.6.5、背景简写属性 background属性
文学剧本
background: background-color background-image  background-repeat background-position;
/*引⽤⼀张背景图*/
background: #fff url(images/3_04.jpg) 27px 73px no-repeat;
/*引⽤多张背景图直接⽤逗号隔开即可*/
background: url(images/2_07.jpg) 15px 99px no-repeat , url(images/2_08.jpg) 373px 99px no-repeat,url(images/2_09.jpg)  731px 99px no-repeat;

本文发布于:2023-07-31 19:08:36,感谢您对本站的认可!

本文链接:https://www.wtabcd.cn/fanwen/fan/82/1125011.html

版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。

标签:背景图   属性   背景   填充   不会
相关文章
留言与评论(共有 0 条评论)
   
验证码:
推荐文章
排行榜
Copyright ©2019-2022 Comsenz Inc.Powered by © 专利检索| 网站地图