Browse Source

字体文本相关

dongxiuling 2 years ago
parent
commit
c366779336
2 changed files with 45 additions and 0 deletions
  1. 2 0
      css/4_css基础语法.html
  2. 43 0
      css/5_字体相关语法.html

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

@@ -24,6 +24,8 @@
 
         }
 
+        
+
     </style>
 
 </head>

+ 43 - 0
css/5_字体相关语法.html

@@ -0,0 +1,43 @@
+<!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>
+        div{
+            width: 300px;
+            height: 50px;
+            background: #f00;
+
+            /* 字体相关属性 */
+            /* 字体 */
+            font-family:'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
+            /* 浏览器默认字体大小16px 浏览器支持的最小字体大小12px */
+            font-size:12px;
+            /* 字体粗细 100-900 默认值400 700|bold*/
+            font-weight:700;
+            /* 字体样式italic 斜体|normal正常 */
+            font-style: italic;
+            
+            color:aqua;
+
+            /* 文本相关属性 */
+            /* 文本水平对齐 left|center|right*/
+            /* text-align: center; */
+            /* 文本垂直居中 通过line-height=height 实现单行文本垂直居中*/
+            line-height:50px;
+            /* 文本首行缩进 */
+            text-indent:30px;
+
+        }
+
+    </style>
+</head>
+<body>
+
+    <div>我是一个DIV</div>
+    
+</body>
+</html>