dongxiuling 1 год назад
Родитель
Сommit
c66ba2cadd
1 измененных файлов с 55 добавлено и 0 удалено
  1. 55 0
      css/4_基础样式.html

+ 55 - 0
css/4_基础样式.html

@@ -0,0 +1,55 @@
+<!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>
+        #div1 {
+            /* 宽高  */
+            width: 1200px;
+            height: 800px;
+            /* 背景 */
+            /* background: red; */
+            background-color: red;
+            background-image: url(../images/img01.jpeg);
+            /* repeat|no-repeat */
+            background-repeat: no-repeat;
+            /* 背景图片位置 水平(固定值|left|center|right) 垂直(固定值|top |center|bottom) */
+            /* background-position: -100px 200px ; */
+            background-position: center top ;
+            /* 简写 */
+            background: red url(../images/img01.jpeg) no-repeat center top ;
+        }
+        #div2{
+            width: 300px;
+            height: 50px;
+            background: red;
+
+            /* 字体相关属性 */
+            /* 字体大小 最小12px  默认大小16*/
+            font-size:25px;
+            /* 字体粗细 100 -900 默认值400|normal bold|700 */
+            font-weight:200 ;
+            /* 字体 */
+            font-family:Microsoft YaHei,Heiti SC,tahoma,arial,Hiragino Sans GB,"\5B8B\4F53",sans-serif;
+            /* 样式 风格 italic|normal */
+            font-style: normal;
+
+        }
+
+
+
+    </style>
+</head>
+
+<body>
+    <!-- <div id="div1">1111111</div> -->
+    <div id="div2">我是一个DIV</div>
+
+
+</body>
+
+</html>