dongxiuling 2 лет назад
Родитель
Сommit
1cf081ad55
4 измененных файлов с 35 добавлено и 0 удалено
  1. BIN
      .DS_Store
  2. 35 0
      css/4_css基础语法.html
  3. BIN
      css/img01.jpg
  4. BIN
      css/img02.jpg

+ 35 - 0
css/4_css基础语法.html

@@ -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>