-
Notifications
You must be signed in to change notification settings - Fork 1
/
test.html
94 lines (78 loc) · 1.53 KB
/
test.html
1
2
3
4
5
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
<html>
<head>
<style>
body {
/* height: 1500px; */
}
/* * {
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
} */
#AA {
position: relative;
/* top: 50px; */
/* background-color: green; */
border-color: green;
border-style: solid;
/* border-radius: 2px; */
}
#BB {
/* position: relative; */
/* background-color: red; */
/* top: -20px;
left: 20px;
background-color: red;
width: 500px; */
}
#CC {
position: relative;
/* top: 50px; */
background-color: yellow;
}
div {
position: relative; /* 相对定位或绝对定位均可 */
/* width:500px; */
/* height:300px; */
top: 50%;
/* left: 50%; */
/* margin: -150px 0 0 -250px; 外边距为自身宽高的一半 */
background-color: pink; /* 方便看效果 */
margin: 0 auto;
}
</style>
</head>
<body>
<!-- <div id="AA">
<h1>HELLO AAAAAAA</h1>
<h2>WORLD AAAAAA</h2>
<div id="CC">
<h1>HELLO CCC</h1>
<h2>WORLD CCCCC</h2>
</div>
</div> -->
<div id="BB">
<h1>HELLO BBBBB</h1>
<h2>WORLD BBBB</h2>
</div>
<script>
console.log(window.fun1);
console.log(window.fun2);
console.log(window.fun3);
fun1('fun1');
fun2('fun2');
fun3('fun3');
// console.log(typeof window.fun1);
// console.log(typeof window.fun2);
// console.log(window);
function fun1(params) {
this.name = 'fun1';
console.log(this.name)
}
const fun2 = function (params) {
this.name = 'fun2';
console.log(this.name)
}
</script>
</body>
</html>