@@ -0,0 +1,130 @@
+<!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-style: none;
+ text-decoration: none;
+ box-sizing: border-box;
+ }
+ /* 标签选择器 */
+ div {
+ width: 200px;
+ height: 200px;
+ background: #00f;
+ /* id选择器 */
+ #part1 {
+ background-color: red;
+ /* class选择器 */
+ .part2 {
+ background-color: #ff0;
+ /* 包含选择器 后代选择器 */
+ #part1 span {
+ color: #ff0;
+ font-size: 30px;
+ /* 伪类选择器
+ :hover 滑过
+ :first-child 第一个子类
+ :last-child 最后一个子类
+ :nth-child(n) 自定义子类
+ even 偶数 2n
+ odd 奇数 2n+1
+ ul li:first-child {
+ color: red;
+ 伪元素选择器
+ ::after/::before {
+ content:''
+ p::after {
+ content: "还在上课";
+ color: #00f;
+ p::before {
+ content: "中午了";
+ color: #f0f;
+ /* 子类选择器 用>连接 */
+ #part1>span {
+ color: #0ff;
+ /* 群组选择器 用,连接 */
+ p,h1 {
+ color: pink;
+ /* 属性选择器 */
+ img[alt='www'] {
+ + 相邻选择器
+ h3+h4 {
+ ~ 兄弟选择器
+ h2 ~ h3 {
+ color: purple;
+ h2 ~ h5 {
+ !important 优先级:正无穷
+ b {
+ color: red !important;
+ </style>
+ </head>
+ <body>
+ <div id="box">
+ <div id="part1" class="part2">
+ <span> hello </span>
+ </div>
+ <b>哇哇哇哇哇哇哇哇</b>
+ <p>今天星期六</p>
+ <ul id="mode1">
+ <li>你好</li>
+ </ul>
+ <ul id="mode2">
+ <ul id="mode3">
+ <a href="">你好</a><a href="">你好</a><a href="">你好</a>
+ <h1>哈哈哈</h1>
+ <img src="../1.html/images/1.png" alt="www">
+ <h2>哈哈哈2</h2>
+ <h3>哈哈哈3</h3>
+ <h4>哈哈哈4</h4>
+ <h5>哈哈哈5</h5>
+ </body>
+</html>
@@ -0,0 +1,18 @@
+<head>
+ <meta charset="UTF-8">
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
+</head>
+<body>
+ <!--
+ 选择器优先级:
+ !important > 内联样式 > id选择器 >类选择器 = 伪类选择器 = 属性选择器 > 伪元素选择器 = 标签选择器 > 通配符选择器
+ 正无穷 1,0,0,0 0,1,0,0 0,0,1,0 0,0,0,1 0,0,0,0
+ html标签为什么要语义化?
+ 1.便携开发,可以帮助快速阅读代码
+ 2.为了方便搜索引擎 进行爬虫
+ -->
+</body>