演示代码:
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title></title>
<style type="text/css">
div{
width: 400px;height: 1000px;
/* background-color: #00ff00;
background-image: url(bj.jpg);
background-repeat: no-repeat;
background-size: 300px 90px;
background-position: 20px 100px;
background-attachment: fixed; */
background: #00ff00 url(bj.jpg) no-repeat 20px 100px/300px 90px fixed;
}
</style>
</head>
<body>
<!--
背景简写:
background: 颜色值 背景图片 背景重复 背景定位/背景尺寸 背景固定;
1,可以在一个属性中设置所有背景属性
2,某些个值可不写
3,输入代码少,浏览器对背景简写支持度高
-->
<div></div>
</body>
</html>