CSS background 属性详解
语法:
background: bg-color bg-image position/bg-size bg-repeat bg-origin bg-clip bg-attachment initial|inherit;
Note: If one of the properties in the shorthand declaration is the bg-size property, you must use a / (slash) to separate it from the bg-position property, e.g. background:url(smiley.gif) 10px 20px/50px 50px; will result in a background image, positioned 10 pixels from the left, 20 pixels from the top, and the size of the image will be 50 pixels wide and 50 pixels high.
Note: If using multiple background-image sources but also want a background-color, the background-color parameter needs to be last in the list.
background-color
Default value: transparent
The background-color property sets the background color of an element.
The background of an element is the total size of the element, including padding and border (but not the margin)(包括内边距和边框).
background-position
The background-position property sets the starting position of a background image(背景图片的开始位置).
Tip: By default, a background-image is placed at the top-left corner of an element, and repeated both vertically and horizontally.
background-size
The background-size property specifies the size of the background images.
语法:
background-size: auto|length|cover|contain|initial|inherit;
background-repeat
The background-repeat property sets if/how(背景图片的重复/循环方式) a background image will be repeated.
By default, a background-image is repeated both vertically and horizontally.
Tip: The background image is placed according to the background-position property. If no background-position is specified, the image is always placed at the element's top left corner.
background-repeat: repeat|repeat-x|repeat-y|no-repeat|initial|inherit;
background-origin
Default value: padding-box
The background-origin property specifies where the background image is positioned.
Note: If the background-attachment property is set to "fixed", this property has no effect.
background-origin: padding-box|border-box|content-box|initial|inherit;
background-clip
The background-clip property specifies the painting area of the background.
background-clip: border-box|padding-box|content-box|initial|inherit;
background-attachment
The background-attachment property sets whether a background image is fixed or scrolls with the rest of the page.
background-attachment: scroll|fixed|local|initial|inherit;
CSS background 属性详解的更多相关文章
- CSS中background属性详解
CSS背景属性 background css 说明 background-image:url(图片的网址); 背景图 background: url( 图片的网址 ); 背景 background-c ...
- [转]CSS vertical-align属性详解 作者:黄映焜
CSS vertical-align属性详解 posted @ 2014-08-26 17:44 黄映焜 前言:关于vertical-align属性. 实践出真知. 垂直居中. 第二种用法. ...
- css 12-CSS3属性详解:动画详解
12-CSS3属性详解:动画详解 #前言 本文主要内容: 过渡:transition 2D 转换 transform 3D 转换 transform 动画:animation #过渡:transiti ...
- css 11-CSS3属性详解(一)
11-CSS3属性详解(一) #前言 我们在上一篇文章中学习了CSS3的选择器,本文来学一下CSS3的一些属性. 本文主要内容: 文本 盒模型中的 box-sizing 属性 处理兼容性问题:私有前缀 ...
- css 14-CSS3属性详解:Web字体
14-CSS3属性详解:Web字体 #前言 开发人员可以为自已的网页指定特殊的字体(将指定字体提前下载到站点中),无需考虑用户电脑上是否安装了此特殊字体.从此,把特殊字体处理成图片的方式便成为了过去. ...
- css display属性详解
css display属性在对css做layout设计时非常重要,它的值有以下几种: Value Description Play it inline Default value. Displays ...
- CSS透明属性详解代码
透明往往能产生不错的网页视觉效果,先奉上兼容主流浏览器的CSS透明代码: 代码如下: .transparent_class { filter:alpha(opacity=50); -moz-opaci ...
- CSS边框-属性详解
图解CSS padding.margin.border属性 W3C组织建议把所有网页上的对像都放在一个盒(box)中,设计师可以通过创建定义来控制这个盒的属性,这些对像包括段落.列表.标题.图片以及层 ...
- css float属性详解
定义和用法 float 属性定义元素在哪个方向浮动.以往这个属性总应用于图像,使文本围绕在图像周围,不过在 CSS 中,任何元素都可以浮动.浮动元素会生成一个块级框,而不论它本身是何种元素.如果浮动非 ...
随机推荐
- CentOS 7 主机名bogon解决办法
转https://blog.csdn.net/qq_24221531/article/details/80334942 一.修改linux主机的配置文件/etc/hostname 和 /etc/hos ...
- DB2 Check Pending Script
转载 http://www.zinox.com/archives/144 Thanks to Max Petrenko of DB2 Toronto Lab for sharing a very us ...
- (转)GlusterFS 01 理论基础,企业实战,故障处理
https://jaminzhang.github.io/glusterfs/GlusterFS-01-Theory-Basis/--------GlusterFS 01 理论基础 https://j ...
- 【Kafka】Broker之Server.properties的重要参数说明
名称 描述 类型 默认值 有效值区间 重要程度 zookeeper.connect zk地址 string 高 advertised.host.name 过时的:只有当advertised.liste ...
- Nginx教程(6) 动静分离架构
一.原理 Nginx 动静分离简单来说就是把动态跟静态请求分开,不能理解成只是单纯的把动态页面和静态页面物理分离.严格意义上说应该是动态请求跟静态请求分开,可以理解成使用Nginx 处理静态页面,To ...
- 【c++】类中的const成员
const成员变量 举个例子 #include <iostream> using namespace std; class A { public: A(int size) : SIZE(s ...
- 费了个劲的git
终于学会了git,表示不容易,个人表示总结一下... 1.设置个人PC上的git master路径,ok没问题,用时1min 2.从码云代码仓库克隆已写代码,也很简单,用时2min 3.将本机器内文 ...
- IOS Masonry自动布局
之前项目用Frame布局,这个项目登录用了VFL,后来觉得用Masonry,前天布局TableViewCell时用了下 ,觉得还不错. #import "Masonry.h" #i ...
- SQL Serever学习11——数据库的安全管理
公司管理软件设计完成,但是日常工作繁忙,向领导提出增加几个管理员,帮助管理和维护系统,领导同意了,但是要求一定要管理好这几个管理员用户,保证数据库的安全. 修改身份验证模式 数据库验证机制 sqlse ...
- 您必须先调用“WebSecurity.InitializeDatabaseConnection”方法,然后再调用"WebSecurity"类的任何其他方法。
今天调试程序的时候出现了这个是,可惜没截图! 您必须先调用“WebSecurity.InitializeDatabaseConnection”方法,然后再调用"WebSecurity&quo ...