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