一、基本框架
<!DOCTYPE html>
<html>
<head>
<title>网页标题</title>
<meta charset="utf-8">
</head>
<body>
内容...
</body>
</html>
二、标签
<h1>1号标题,最大</h1>
<h2>...</h2>
<h3>...</h3>
<h4>...</h4>
<h5>...</h5>
<h6>6号标题,最小</h6>
<p>段落</p>
<!-- 换行 -->
<br>
<!-- 水平线 -->
<hr>
三、文本格式化
不重要,稍作了解就好。
标签 | 解释 |
---|---|
b | 粗体文本 |
code | 计算机代码 |
em | 强调文本 |
i | 斜体文本 |
kbd | 键盘输入 |
pre | 预格式化文本 |
small | 更小的文本 |
strong | 重要的文本 |
abbr | 缩写 |
address | 联系信息 |
bdo | 文字方向 |
blockquote | 从另一个源引用的部分 |
cite | 工作的名称 |
del | 删除的文本 |
ins | 插入的文本 |
sub | 下标文本 |
sup | 上标文本 |
四、链接
<!-- 普通的链接 -->
<a href="http://www.example.com/">链接文本</a>
<!-- 图像链接 -->
<a href="http://www.example.com/"><img src="URL" alt="替换文本"></a>
<!-- 邮件链接-->
<a href="mailto:webmaster@example.com">发送e-mail</a>
<!-- 书签-->
<a id="tips">提示部分</a>
<a href="#tips">跳到提示部分</a>
五、图像
<img loading="lazy" src="URL" alt="图片没显示的文本" height="100" width="100">
六、列表
1.无序列表
<ul>
<li>条目1</li>
<li>条目2</li>
</ul>
2.有序列表
<ol>
<li>条目1</li>
<li>条目2</li>
</ol>
3.自定义列表
<dl>
<dt>条目1</dt>
<dd>描述条目1</dd>
<dt>条目2</dt>
<dd>描述条目2</dd>
</dl>
七、区块
<div>块级元素,包含的元素会自动换行</div>
<span>行内元素,在它的前后不会换行</span>
八、表格
<table border="1">
<tr>
<th>表格标题1</th>
<th>表格标题2</th>
</tr>
<tr>
<td>表格数据1</td>
<td>表格数据2</td>
</tr>
</table>
九、表单
<form action="demo_form.php" method="post/get">
<input type="text" name="email" size="40" maxlength="50">
<input type="password">
<input type="checkbox" checked="checked">
<input type="radio" checked="checked">
<input type="submit" value="Send">
<input type="reset">
<input type="hidden">
<select>
<option>选项1</option>
<option selected="selected">选项2</option>
<option>选项3</option>
</select>
<textarea name="comment" rows="60" cols="20"></textarea>
</form>
十、框架
<!-- iframe 元素会创建包含另外一个文档的内联框架 -->
<iframe src="demo_iframe.htm"></iframe>
十一、实体
<!-- 小于号 < -->
<
<!-- 大于号 > -->
>
<!-- 和号 & -->
&
<!-- 引号 " -->
"
<!-- 版权 © -->
©