语法缩写如下:

background : [background-color] | [background-image] | [background-position][/background-size] | [background-repeat] | [background-attachment] | [background-clip] | [background-origin],...

注意:用逗号隔开每组background的缩写值;如果有size值,需要紧跟position并且用"/"隔开;分解写法时,background-color只能设置一个。

例如:

background:url(./image.jpg) no-repeat left top / 200px 70px,url(./image.jpg) no-repeat right bottom / 150px 60px;

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>多重背景</title>
<style type="text/css">
.demo {
width: 300px;
height: 140px;
border: 1px solid #999;
background:url(http://static.mukewang.com/static/img/logo_index.png) no-repeat left top / 200px 70px,
url(http://static.mukewang.com/static/img/logo_index.png) no-repeat right bottom / 150px 60px;
}
</style>
</head>
<body>
<div class="demo"></div>
</body>
</html>

最新文章

  1. JS数组求最大值和最小值
  2. jquery最常用的几个方法。
  3. 在Python中,令values=[0,1,2];values[1]=values,为何结果是[0,[...],2]?
  4. Lunix中文乱码解决方案
  5. 2D丛林逃生
  6. CentOS 6.5 开机启动指定服务
  7. 学习TensorFlow,生成tensorflow输入输出的图像格式
  8. Linux时间子系统之(十六):clockevent
  9. kodi18.1设置中文的方法
  10. ubantu16.04安装ns2.34 错误
  11. APP包打包签名步骤
  12. 【移动端】300ms延迟以及点透事件原因以及解决方案
  13. windows程序设计 获取系统文件路径
  14. R 语言 Windows 环境 安装与Windows下制作R的package--Rtools
  15. MySql概念及常用Sql
  16. Oracle中删除用户下所有对象的多种方法
  17. Python中type的用法
  18. 最新学习springboot 配置注解
  19. Python2 读取表格类型文件
  20. 解题:ZJOI 2006 书架

热门文章

  1. QT 操作数据库
  2. 在vim中设置将tab自动转化为4个空格
  3. The Socket API, Part 4: Datagrams
  4. JAVA基础之String基本操作
  5. IOS 弹出菜单的动态效果
  6. mybatis 处理数组类型及使用Json格式保存数据 JsonTypeHandler and ArrayTypeHandler
  7. 【Shell脚本学习11】Shell注释
  8. 【Java线程池快速学习教程】
  9. Shell学习笔记 - 循环语句
  10. 如果AlertView输入框为空,则禁止点击确定按钮