初识HTML

HTML(HyperText Markup Language,超文本标记语言),前端三剑客之一。
查询文档:www.w3school.com.cn

常见标签

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
<h1>标题</h1> 
<p>段落</p>

<!-- 布局用标签 -->
<div>独占一行,可指定宽高</div>
<span>行内元素,不可指定宽高,由内容决定</span>

<!-- 图片 -->
<img src="url" alt="描述信息">
<!-- 视频 -->
<video src="url" controls="播放控件">
<!-- 音频 -->
<audio src="url" controls="播放控件">
<!-- 超链接 -->
<a href="url" target="打开行为(_self 当前页打开, _blank 空白页打开)">

<!-- 水平分割线 -->
<hr>
<!-- 换行 -->
<br>
<!-- 加粗 -->
<b> / <strong>
<!-- 下划线 -->
<u> / <ins>
<!-- 倾斜 -->
<i> / <em>
<!-- 删除线 -->
<s> / <del>

<!-- 表单 -->
<form action="表单数据提交至url" method="表单数据发送方式(GET/POST)">
<!-- 表单项,type有text,radio,checkbox,submit等 -->
<input type="指定类型" name="变量名" value="变量值">
<input type="text">
<input type="password">
<input type="radio" name="同组radio,变量名应相同">
<input type="checkbox">
<input type="file">
<input type="data/time/datetime-local">
<input type="number">
<input type="email">
<input type="hidden">
<input type="submit/reset/button">
<!-- 下拉列表 -->
<select>
<option value="变量值">选项1</option>
</select>
<!-- 文本输入区域 -->
<textarea></textarea>
</form>

<!-- 表格 -->
<table style="border-collapse: collapse; 消除表格间隙">
<!-- table row -->
<tr>
<!-- table head -->
<th>
<!-- table data -->
<td>
</tr>
</table>

特殊字符

空格,&nbsp;
小于,&lt;
大于,&gt;