|
@@ -0,0 +1,35 @@
|
|
|
|
+<!DOCTYPE html>
|
|
|
|
+<html lang="en">
|
|
|
|
+<head>
|
|
|
|
+ <meta charset="UTF-8">
|
|
|
|
+ <meta http-equiv="X-UA-Compatible" content="IE=edge">
|
|
|
|
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
|
|
+ <title>Document</title>
|
|
|
|
+ <style>
|
|
|
|
+ /* 1取到这个元素 */
|
|
|
|
+ div{
|
|
|
|
+ width:600px;
|
|
|
|
+ height:350px;
|
|
|
|
+ /* 背景复合属性 颜色 背景图片 */
|
|
|
|
+ /* background: red; */
|
|
|
|
+ background-color:red ;
|
|
|
|
+ background-image: url(img02.jpg);
|
|
|
|
+ /* 背景图片重复 repeat(默认) |no-repeat*/
|
|
|
|
+ background-repeat:no-repeat ;
|
|
|
|
+ /* 背景位置 水平 垂直 (一种方式可以用固定单位 二种水平:left center right 垂直: top center bottom) */
|
|
|
|
+ background-position:200px -100px;
|
|
|
|
+
|
|
|
|
+ /*合并 简化为 */
|
|
|
|
+ /* background:red url(img02.jpg) no-repeat left center; */
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ </style>
|
|
|
|
+
|
|
|
|
+</head>
|
|
|
|
+<body>
|
|
|
|
+ <div>111</div>
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+</body>
|
|
|
|
+</html>
|