CSS-background背景相关属性
2020-03-12 12:16
302 查看
1、background背景相关
background-color:背景颜色; 颜色单词 red blue green.... 十六进制值 # 0-9 a-f 三原色值 rgb(0,0,0) 0-255
example: background-color:pink; background-color:#ccc; background-color: rgb(255,255,255);
background-image:url("图片路径"); 1:默认情况是平铺的 2:与img标签的区别: img是标签,是结构,占据页面位置 挂在墙上的一幅画,可以盖住背景图 backgorund-image:;是css样式,不占据位置 画在墙上的一幅画,被img盖住
example: background-image:url("img/list.png");
background-repeat:图片是否重复; repeat 重铺(默认值) no-repeat 不重铺 repeat-x 水平重铺 repeat-y 垂直重铺
example background-repeat:repeat;(默认值)(见下图左) background-repeat:no-repeat;(见下图右)
background-position:背景定位; 1:关键字写法 水平值 left center right 垂直值 top center bottom 2:具体像素位置
example: 1:关键字写法 background-position:left top;/*默认值*/ background-position:left center;(左中)(见下图) 2:具体像素写法 background-position:-113px -208px;/*改变背景图位置*/
background-attachment:scroll;/*背景关联 滚动*/ background-attachment:fixed;/*背景关联 固定*/
- 点赞
- 收藏
- 分享
- 文章举报
相关文章推荐
- CSS-Learning | background-image属性如何设置背景图片以及相关背景图片语法
- CSS下背景属性background的使用方法
- CSS3-新增背景系列background相关属性
- CSS中背景的综合属性background
- CSS背景图像位置属性background-position百分比详解
- css背景属性background-position如何理解?
- CSS背景属性Background详解
- 在CSS中对背景图片进行设置相关属性
- CSS背景属性Background详解
- 学习CSS的背景图像属性background
- [转载]CSS背景:css background属性全解析
- WEB标准学习路程之"CSS":3.背景Background属性
- 前端CSS学习-Background背景相关
- CSS - 05 背景,文本相关属性,内边距,外边距
- css 背景图片相关属性
- 前端CSS学习-Background背景相关
- css中background背景属性概述(支持原创)
- CSS背景属性Background详解
- CSS 样式 - background 背景属性
- CSS中背景图片的属性:background-repeat、background-position、background-size