e 1 年之前
父节点
当前提交
b4c5480786
共有 2 个文件被更改,包括 127 次插入0 次删除
  1. 49 0
      css/3.常用文字样式.html
  2. 78 0
      css/4.垂直导航.html

+ 49 - 0
css/3.常用文字样式.html

@@ -0,0 +1,49 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+    <meta charset="UTF-8">
+    <meta name="viewport" content="width=device-width, initial-scale=1.0">
+    <title>Document</title>
+    <style>
+        #box1 {
+            width: 300px;
+            height: 300px;
+            /* background: rgba(255, 0, 0,0.6); */
+            background: #f00;
+            opacity: .6;
+            /* font-size: 10px; */
+            /* font-weight:bolder; */
+            /* font-family: 'Courier New', Courier, monospace; */
+            /* font-style: italic; */
+            color: #000;
+        }
+        /* 
+            透明:opacity:0-1  可以写小数 小数可以省略0 全部透明
+            16进制颜色          rgb                 rgba(a=>alpha<透明>)
+            红 #ff0000 #f00        255,0,0              0-1 可以写小数 小数可以省略0 只对使用的元素进行改变
+            黄 #ffff00 #ff0        255,255,0
+            蓝 #0000ff #00f        0,0,255
+            绿 #00ff00 #0f0        0,255,0
+            黑 #000000 #000        0,0,0
+            白 #ffffff #fff        255,255,255
+        */
+    </style>
+</head>
+<body>
+    <!-- 
+        颜色:color
+        字体大小:浏览器默认字体大小是16px
+        浏览器最小可识别 12px
+        font-size
+        字体粗细:font-weight
+        粗 bold bolder 600-900
+        正常 normal 400-500
+        细 lighter 100-300
+        字体:font-family
+        字体样式:font-style 
+        italic 倾斜
+        normal 正常
+     -->
+    <div id="box1">这是一个新盒子</div>
+</body>
+</html>

+ 78 - 0
css/4.垂直导航.html

@@ -0,0 +1,78 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+    <meta charset="UTF-8">
+    <meta name="viewport" content="width=device-width, initial-scale=1.0">
+    <title>Document</title>
+    <style>
+        .list{
+            /* 清除ul的默认样式 */
+            list-style: none;
+        }
+        /* 包含选择器 */
+        .list li {
+            width: 450px;
+            height: 80px;
+            background: #0f0;
+            /* 文字在已知宽高的盒子内
+                垂直居中的line-height就是当前高度
+            */
+            /* 文本位置 */
+            text-align: center;
+            /* 行间距 */
+            line-height: 80px;
+        }
+        a {
+            /* 清除a标签默认样式 */
+            text-decoration: none;
+            /* text-decoration: underline; */
+            /* 添加划线
+                underline 下划线
+                overline 上划线
+                line-through 删除线
+                none 无样式
+            */
+        }
+
+        /* 划过 */
+        /* 伪元素选择器 */
+        /* :hover 划过*/
+        /* .list li:hover{
+            background: #ff0;
+        }
+        .list li a:hover {
+            color: red;
+        } */
+        .list li:nth-child(3) a {
+            color: red;
+        }
+        .list li:last-child a {
+            color: #000;
+        }
+        /* 
+            :nth-child()自定义子类
+            奇数 2n+1 odd
+            偶数 even 2n
+            :first-child 第一个
+            :last-child 最后一个
+        */
+    </style>
+</head>
+<body>
+    <!-- 
+        类选择器:
+        在body标签中 
+            开始标签上 class="xxx"
+        在style上 
+            .xxx {代码}
+     -->
+
+    <ul class="list">
+        <li><a href="">首页</a></li>
+        <li><a href="" >我的</a></li>
+        <li><a href="">购物车</a></li>
+        <li><a href="">订单</a></li>
+        <li><a href="">浏览记录</a></li>
+    </ul>
+</body>
+</html>