1
2
3
4
5
html基础复习6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
css复习31
32
33
34
35
36
37
38
39
40
41
42
43 span{
44 font:900 normal 30px/100px '首选字体', '备用字体1', '备用字体2';
45 text-align:center;
46 color:red;
47 text-decoration:underline;
48 letter-spacing:3px;
49 word-spacing:10px;
50 text-indent:2em;
51 }
52
53
54
55
56 /*选择器: css连接html标签的桥梁,建立连接后就可以控制标签样式*/
57 /*标签 类 id*/
58 /*组合选择器*/
59 /*伪类选择器*/
60
61 /*优先级:*/
62 /*基础选择器: !important > id > 类[属性] > 标签 > 通配*/
63 /*组合选择器: 权重(同类型个数比较)*/
64 .b > .s{}
65 .b .s{}
66 .b + .s{}
67 .b.s{}
68 .b[class]{}
69
70 #ss{font-size:50px; }
71 span.s2{font-size:40px; }
72 [class]{font-size:35px; }
73 .s1{font-size:30px; }
74 span{font-size:20px!important; }
75
76 /*标签名 | . | #*/
77 /*后代"空格"(子代) | 兄弟"~"(相邻) | 群组"," | 交集"紧挨着"*/
78 /*[属性名="属性值"]*/
79
80
81
82 12345
83
84
85 /*伪类选择器*/
86 /*:link :hover(鼠标悬浮) :active(鼠标点击中) :visited*/
87 /*:nth-child() 先位置后类型 :nth-of-type() 先类型后位置*/
88 /*:not()*/
89 /*:before(盒子渲染前) :after(盒子渲染后) :focus(表单标签获取焦点)*/
90 p:nth-child(3){font-size:100px}
91 p:nth-of-type(2n){font-size:50px}
92
93
94 span
95
pp1
96
pp2
97