代码
第一章
1.html结构
<html>
<head></head> <!--网页头部-->
<body></body> <!--网页主体-->
</html>
2.html打开方式
1)用浏览器打开 (浏览方式)
2)用文本编辑器打开 (编辑方式)
注: HTML全称 :hypter text markup language (超文本标记语言)
3.标题标签
<title></title> (标题)
4.meta标签
<meta charset="utf-8"/> (设置网页的字符编 号)
<meta name="keywords" content="内容" /> (关键词)
<meta name="description" content="内容"/> (网页描述)
5.h标签
<h1></h1> <h2></h2> <h3></h3> <h4></h4> <h5></h5> <h6></h6>
注意:h标签只有h1到h6,且依次减小
6.段落标签
<p></p>
7.换行标签
<br />
8.水平线标签
<hr />
9.字体样式标签
<strong></strong> (加粗)
<em></em> (斜体)
10.特殊符号
空格 大于号(>) > 小于号(<)<
引号(") " 版权符号 ©;
11.图片标签
<img src="图片地址" alt="当图片找不到时提示的文字"
title="鼠标放在上面时显示的文字" width="图片宽度" height="图片高度"/>
12.链接标签
<a herf="path" target="目标窗口位置"> (链接文本或图像)
<a herf="#head">返回顶部</a>
<a herf="a.html" target="-blank">跳到a.html</a>
<a herf="mailto:2424176683@qq.com">联系我们</a>
13.a标签(超链接)
<a herf="跳转的路径" target="目标窗口位置"></a>
注意:target的常用值:-self 当前窗口 -blank 新窗口
锚链接使用步骤
1).定义锚点
<a name="名字">锚点</a>
2).定义链接
<a herf="#锚点名">链接</a>
注意:#可以看出当前页面
1).锚点名:表示要跳到指定的锚点位置(就是定义锚点,name的属性值)
2).功能性链接
例:<a herf="mailto:邮箱地址"></a>
第二章
1.列表
1).有序列表
<ol>
<li>内容</li> (列表项)
</ol>
2).无序列表
<ul>
<li>内容</li>
</ul>
3).定义列表
<dl>
<dt></dt> (声明列表项)
<dd></dd> (列表项)
</dl>
注意:li 独占一行
2.表格
<table border="1">
<tr>
<td></td>
</tr>
</table>
tr 列 td 行
<td colspan="占得列数" rowspan="占得行数"></td>
3.视频
推荐使用
<video controls>
<source src="xx.MP4" type="video/mp4"/>
<source src="xx.webm" type="video/webm">
</video>
src 为图片地址 type 为视频格式
4.音频
<audio controls>
<source src="xx.MP3" type="audio/mp3"/>
<source src="xx.ogg" type="audio/ogg">
</audio>
注意:
<!--../--> 表示返回上一级目录
5.结构化元素
<header></header> 网页头部
<footer></footer> 网页尾部
<section></section> 网页的独立区域
<article></article> 表示文章
<aside></aside> 表示相关内容或应用(侧边栏)
<nav></nav> 导航
6.网页结构
<header></header> 网页头部
<section></section> 网页主体
<footer></footer> 网页尾部
7.iframe内联框架
语法:<iframe src="页面地址" name=""/>
1).定义iframe
<iframe src="" name=""/>
2).定义超链接并指定超链接的内容要放置的地方(由target指定)
<a href="" target="">xx</a>
浙公网安备 33010602011771号