-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathhtmlExec
More file actions
executable file
·366 lines (338 loc) · 10.5 KB
/
htmlExec
File metadata and controls
executable file
·366 lines (338 loc) · 10.5 KB
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
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
<!DOCTYPE HTML>
<html>
<head>
<title>HTML EXERCISE</title>
<meta charset="utf-8">
<meta name="description" content="HTML练习">
<style>
.dropbtn {
background-color: #4CAF50;
color: white;
padding: 16px;
font-size: 16px;
border: none;
cursor: pointer;
}
.dropdown {
position: relative;
display: inline-block;
padding-top: 100px;
}
.dropdown-content {
display: none;
position: absolute;
background-color: #f9f9f9;
min-width: 160px;
box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
}
.dropdown-content a {
color: black;
padding: 12px 16px;
text-decoration: none;
display: block;
}
.dropdown-content a:hover {background-color: #f1f1f1}
.dropdown:hover .dropdown-content {
display: block;
}
.dropdown:hover .dropbtn {
background-color: #3e8e41;
}
.dropdown .tooltiptext {
visibility: hidden;
width: 120px;
background-color: black;
color: #fff;
text-align: center;
border-radius: 6px;
padding: 6px 0;
position: absolute;
left: 110%;
z-index: 1;
opacity: 0;
transition: opacity 1s;
}
.dropdown .tooltiptext::after {
content: " ";
position: absolute;
top: 50%;
right: 100%;
margin-top: -5px;
border-width: 5px;
border-style: solid;
border-color: transparent black transparent transparent;
/*opacity: 0;
transition: opacity 1s;
*/ }
.dropdown:hover .tooltiptext {
visibility: visible;
opacity: 1;
}
.img {
border: 1px solid #ccc;
margin: 5px;
float: left;
width: 180px;
box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19);
}
.img:hover {
border: 1px solid #777;
}
.img img {
width: 100%;
height: auto;
}
.desc {
padding: 15px;
text-align: center;
}
@keyframes logo_anim {
from{
background-color: red;
}
to {
background-color: yellow;
}
}
.rotate_square {
width: 100px;
height: 100px;
text-align: center;
word-break: break-all;
background-color: blue;
transition: width 2s, height 2s, transform 2s;
animation: logo_anim 2s;
position: relative;
left: 50%;
}
.rotate_square:hover {
width: 200px;
height: 200px;
transform: rotate(360deg);
}
.button {
display: inline-block;
padding: 15px 25px;
font-size: 24px;
cursor: pointer;
text-align: center;
text-decoration: none;
outline: none;
color: #fff;
background-color: #4CAF50;
border: none;
border-radius: 15px;
box-shadow: 0 9px #999;
position: relative;
top: 200px;
left: 100px;
}
.button:hover {background-color: #3e8e41}
.button:active {
background-color: #3e8e41;
box-shadow: 0 5px #666;
transform: translateY(4px);
}
</style>
</head>
<body>
<h1
style="background-color: yellow;font-family: verdana;text-align: center;animation: logo_anim 2s">Hello world!</h1>
<a
href="http://www.baidu.com">百度</a>
<table border="1" style="margin-top: 20px">
<tr>
<th>Name</th>
<th>Address</th>
<th>Tel</th>
</tr>
<tr>
<td>Jason</td>
<td>Washington</td>
<td>347-9269</td>
</tr>
<tr>
<td>Valentin</td>
<td>Shenzhen</td>
<td>299-2264</td>
</tr><tr>
<td>Timberland</td>
<td>Chicago</td>
<td>939-7736</td>
</tr>
</table>
<p>这是两段列表</p>
<table border="0">
<tr>
<td>
<ul>
<li>Coffee</li>
<li>Soda</li>
<li>Tea</li>
</ul>
</td>
<td>
<ol>
<li>Chips</li>
<li>Cookies</li>
<li>Nougats</li>
</ol>
</td>
</tr>
</table>
<div>
<form>
用户名:<input type="text" name="user_name">
加密:<keygen type="security">
<input type="submit">
</form><br>
<form>
<input list="browsers" name="browsers">
<datalist id="browsers">
<option value="Internet Explorer">
<option value="Chrome">
<option value="Safari">
<option value="Opera">
<option value="Firefox">
</datalist>
<input type="submit" value="SUBMIT">
</form>
</div>
<div>
<p><button onclick="onClickCounter()" type="button">点我!</button></p>
</div>
<div style="border: 2px dashed #ccc; width: 320px; text-align: center">
<label for="site_name">网站名:</label><input type="text" name="site_name"/><br>
<label for="site_url">网址:</label><input type="text" name="site_url"><br>
<input type="button" onclick="save()" value="保存记录">
<hr/>
<label for="site_search">查找网址:</label><input type="text" name="site_search"><br>
<input type="button" onclick="find()" value="查找网址"><br>
<p id="find_result"><br></p>
<script type="text/javascript">
function save(){
var site_name = document.getElementById("site_name").value;
var site_url = document.getElementById("site_url").value;
localStorage.setItem(site_name, site_url);
alert("添加成功!");
}
function find(){
var search_site = document.getElementById("site_search").value;
var site_name = localStorage.getItem(search_site);
var find_result = document.getElementById("find_result");
find_result.innerHTML = search_site + "的网址是:" + site_name;
}
</script>
</div>
<p style="text-align: center; background-color: indigo; height: 300px; color: #ffffff; font-family: Arial; font-size: 60px">注意,下拉菜单的visibility要设置成none,而tooltip的visibility是hidden</p>
<div class="dropdown">
<span class="tooltiptext">网址导航</span>
<button class="dropbtn">下拉菜单</button>
<div class="dropdown-content">
<a href="http://www.baidu.com">百度</a>
<a href="http://www.pixiv.com">Pixiv</a>
<a href="http://www.bilibili.com">Bilibili</a>
</div>
</div>
<p style="text-align: center; background-color: purple; height: 200px; color: #ffffff; font-family: Arial; font-size: 60px;">照片墙</p>
<div class="img">
<a target="_blank" href="http://static.runoob.com/images/demo/demo2.jpg">
<img src="http://static.runoob.com/images/demo/demo2.jpg" alt="图片文本描述" width="300" height="200" />
</a>
<div class="desc">这里添加文本描述</div>
</div>
<div class="img">
<a href="http://static.runoob.com/images/demo/demo1.jpg">
<img src="http://static.runoob.com/images/demo/demo1.jpg" alt="图片文本描述" width="300" height="200">
</a>
<div class="desc">这里添加文本描述</div>
</div>
<div class="img">
<a target="_blank" href="http://static.runoob.com/images/demo/demo3.jpg">
<img src="http://static.runoob.com/images/demo/demo3.jpg" alt="图片文本描述" width="300" height="200" />
</a>
<div class="desc">这里添加文本描述</div>
</div>
<div class="img">
<a href="http://static.runoob.com/images/demo/demo4.jpg">
<img src="http://static.runoob.com/images/demo/demo4.jpg" alt="图片文本描述" width="300" height="200">
</a>
<div class="desc">这里添加文本描述</div>
</div>
<h2 style="text-align: center">一段视频</h2>
<div id="video_palyer" style="text-align: center;">
<button onclick="playOrPause()">播放/暂停</button>
<button onclick="zoomOut()">放大</button>
<button onclick="zoomIn()">缩小</button>
<button onclick="normalize()">普通尺寸</button><br>
<video id="video1" width="420">
<source src="http://www.runoob.com/try/demo_source/mov_bbb.mp4" type="video/mp4">
你的浏览器暂不支持HTML5播放!
</video>
<script type="text/javascript">
var mVideo = document.getElementById("video1");
function playOrPause(){
if(mVideo.paused){
mVideo.play();
} else {
mVideo.pause();
}
}
function zoomOut(){
mVideo.width = 560;
}
function zoomIn(){
mVideo.width = 320;
}
function normalize(){
mVideo.width = 420;
}
</script>
</div>
<p style="text-align: center; background-color: yellow; height: 200px; color: #000000; font-family: Arial; font-size: 60px;">旋转LOGO</p>
<div class="rotate_square">我是logo我是logo我是logo我是logo我是logo我是logo我是logo</div>
<div>
<div id="canvas1" style="height: 200px; width: 400px; float: left; margin-top: 100px">
<canvas id="mCanvas1" style="border: 1px solid #000000"></canvas>
<script type="text/javascript">
var c=document.getElementById("mCanvas1");
var ctx=c.getContext("2d");
ctx.fillStyle="#FF0000";
ctx.fillRect(0,0,150,75); <!--在画布上绘制 150x75 的矩形,从左上角开始 (0,0)-->
ctx.font="30px Arial"
ctx.strokeText("Hello world!", 10, 120);
</script>
</div>
<div id="canvas2" style="height: 200px; width: 400px; float: left; margin-top: 100px">
<canvas id="mCanvas2" style="border: 1px solid #000000"></canvas>
<script type="text/javascript">
var c = document.getElementById("mCanvas2");
var ctx = c.getContext("2d");
ctx.moveTo(0,0); <!--开始坐标-->
ctx.lineTo(400,200); <!--结束坐标-->
ctx.stroke(); <!--实际上我们调用了ink的方法,如stroke或fill-->
</script>
</div>
<p style="text-align: center; background-color: green; height: 200px; color: #ffffff; font-family: Arial; font-size: 60px;clear: both">Canvas加载图片</p>
<div id="canvas3" style="height: 200px; widows: 400px; float: left;position: relative;left: 40%">
<div id="img" style="float: left">
<p>Source Image:</p>
<img id="scream" alt="The Scream" height="277" width="220" src="http://www.runoob.com/try/demo_source/img_the_scream.jpg">
</div>
<div id="img_canvas" style="float: left; margin-left: 20px">
<p>Canvas Image:</p>
<canvas id="mCanvas3" style="border: 1px solid #000000" width="250" height="300"></canvas>
<script type="text/javascript">
var c = document.getElementById("mCanvas3");
var ctx = c.getContext("2d");
var img = document.getElementById("scream");
img.onload = function(){
ctx.drawImage(img, 10, 10);
}
</script>
</div>
</div>
<p style="text-align: center; background-color: pink; height: 200px; color: #ffffff; font-family: Arial; font-size: 60px;clear: both;position: relative;top: 200px">CSS3按钮动画<button class="button">Click Me</button></p>
</div>
</body>
</html>