@@ -56,14 +56,33 @@
color: #0f0;
font-size: 30px;
}
- /* 11.通配符选择器 匹配全局* */
+ /* 11.通配符选择器 匹配全局:* */
* {
list-style: none;
text-decoration: none;
+ span {
+ color:red !important;
+ }
+ color: yellowgreen;
+ /* 12.属性选择器
+ 标签[属性=xxx] {
+
+ */
+ /* img {
+ width: 200px;
+ } */
+ img[alt=aaa] {
</style>
</head>
<body>
+ <img src="../html/images/img01.gif" alt="aaa">
+ <span>这是哈哈哈</span>
<div></div>
<div class="new">这是一段新内容</div>
<ul>
@@ -0,0 +1,16 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+ <meta charset="UTF-8">
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
+ <title>Document</title>
+</head>
+<body>
+ <!--
+ 选择器的优先级:
+ !important > 内联样式 > id选择器 > 类选择器 = 伪类选择器 = 属性选择器 > 伪元素选择器 = 标签选择器 > * (通配符选择器)
+ 正无穷 1,0,0,0 0,1,0,0 0,0,1,0 0,0,0,1 0,0,0,0
+ -->
+</body>
+</html>
@@ -0,0 +1,30 @@
+ <style>
+ * {
+ box-sizing: border-box;
+ /*
+ 盒模型:
+ 标准盒模型:width = 内容宽度 + border + padding :box-sizing: content-box;
+ 怪异盒模型(IE盒模型):width = 内容宽度(border + padding +内容宽度):box-sizing: border-box;
+ #box1 {
+ width: 300px;
+ height: 300px;
+ background: #00f;
+ border: 3px solid #000;
+ padding: 20px;
+ margin: 20px;
+ </style>
+ <div id="box1"></div>
@@ -0,0 +1,48 @@
+ <head>
+ <meta charset="UTF-8" />
+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />
+ input {
+ /* 轮廓outline */
+ outline: none;
+ outline: 3px solid #f00;
+ outline-width: 1px;
+ outline-style: dashed;
+ outline-color: purple;
+ /* border: none; */
+ div {
+ /* 将元素转成行内元素 */
+ /* display: inline; */
+ margin-left: 20px;
+ /* 将元素转成块级元素 */
+ /* display: block; */
+ /* 将元素转成行内款元素 */
+ display: inline-block;
+ h2 {
+ /* 将元素隐藏 */
+ display: none;
+ /* color: rgba(0, 0, 0, 0); */
+ /* opacity: 0; */
+ /* 显示元素 */
+ display: block;
+ </head>
+ <body>
+ <input type="text" name="" id="" />
+ <div>111</div>
+ <span>2222</span>
+ <span>333</span><span>444</span>
+ <h2>显示/隐藏</h2>
+ </body>
@@ -0,0 +1,41 @@
+ border: 5px solid #f00;
+ padding:20px;
+ /* padding-left: 70px; */
+ padding 内边距:内容与边框之间的距离 复合属性
+ 一个值:上下左右
+ 两个值:上下 左右
+ 三个值:上 左右 下
+ 四个值:上 右 下 左
+ padding-left
+ padding-right
+ padding-top
+ padding-bottom
+ margin 外边距:边框外的距离 复合属性
+ margin-left
+ margin-right
+ margin-top
+ margin-bottom
+ <div id="box1">hahahah</div>