本文主要参考来自b站《星月教你做网站》
图片部分参考http://www.myaijarvis.com/index.php/archives/280
本文主要关于HTML5部分,关于CSS的之后会再做小结。
- HTML基本元素
<!DOCTYPE html>
<!--让浏览器得知自己要处理的内容是html-->
<html lang="en">
<!--文档中html部分的开始-->
<!--让谷歌浏览器有自动翻译的功能,ch,en-->
<head>
<!--提供有关文档内容和标记信息-->
<meta charset="UTF-8">
<!--源数据,多次功能访问,utf-8的方法对网页进行编码-->
<title>Title</title>
<!--标题-->
</head>
<body>
<h1>big</h1>
<a href="http://hao.qq.com/?unc=o400493_1&s=2&s=o400493_1">hao123</a>
<a href="http://hao.qq.com/?unc=o400493_1&s=2&s=o400493_1" target="_blank">hao123</a>
<!--超链接-->
<b>粗体</b>
<em>斜体</em>
<u>下划线</u>
<s>删除线</s>
</body>
</html>
<h1>big</h1>
<a href="">title</a> 超链接
<b>粗体</b>
<em>斜体</em>
<u>下划线</u>
<s>删除线</s>
- HTML表格元素
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
</head>
<body>
<table border="1px" align="center">
<thead>
<tr>
<th>user</th>
<th>sex</th>
</tr>
</thead>
<tbody>
<tr>
<td>admin</td>
<td>male</td>
</tr>
</tbody>
<tfoot>
<tr>
<td>user</td>
<td>sex</td>
</tr>
</tfoot>
</table>
<br>
<table border="1px">
<tr>
<th rowspan="2">aaa</th>
<th>aaa</th>
<th>aaa</th>
<th>aaa</th>
</tr>
<tr>
<!--<td>aaa</td>-->
<td colspan="2">aaa</td>
<!--合并单元格-->
<td>aaa</td>
</tr>
<tr>
<td>aaa</td>
<td>aaa</td>
<td>aaa</td>
<td>aaa</td>
</tr>
</table>
</body>
</html>
<table border="1px" align="center">//表的边框和格式
<thead>
</thead>
<tbody>
</tbody>
<tfoot>
<tr>//表的行
<td>user</td>//表的列
<td>sex</td>
</tr>
</tfoot>
<th rowspan="2">aaa</th>//合并单元格
<td colspan="2">aaa</td>//合并单元格
</table>
- HTML列表元素
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
</head>
<body>
<ol>
<li>a</li>
<li>b</li>
<li>c</li>
</ol>
<ol reversed>
<li>a</li>
<ol type="a">
<li>a</li>
<li>b</li>
<li>c</li>
</ol>
<li>b</li>
<li>c</li>
</ol>
<ol type="a">
<li>a</li>
<li>b</li>
<li>c</li>
</ol>
<ul>
<li>a</li>
<li>b</li>
</ul>
</body>
</html>
<ol>//有序列表
<li>a</li>
</ol>
<ol reversed>//倒序列表
<ul>//无序列表
<li>a</li>
</ul>
- 表单元素
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>创建表单</title>
</head>
<body>
<form>
<input type="text" value="yyx">
<br><br>
<input type="text">
<br>
<!--text单行文本框,value占位符 placeholder不占文本框的位置 maxlength最大能输入的字符-->
<input type="text" placeholder="yyx">
<br>
<input type="text" placeholder="maxlength" maxlength="8">
<br>
<input type="text" placeholder="yyx" size="50"><!--拓宽单行文本框-->
<br>
<input type="text" placeholder="yyx" readonly>
<br><br><br>
<input type="password" placeholder="password">
<br>
<textarea rows="20" cols="8">yyx</textarea>
</form>
<form>
<input type="button" value="button">
<button>button</button> <!--js合作,并且作为绑定事件-->
<input type="submit" value="submit"><!--提交表单,获取用户输入的值-->
</form>
<form>
<input type="range" min="-100" max="100" step="100" value="0">
<input type="number" min="-100" max="100" value="0">
<!--数字滑动和手动输入数字-->
<br>
<input type="checkbox">
<input type="radio" name="a" checked>
<select>
<option>a</option>
<option>a</option>
<option>a</option>
</select>
<input type="text" list="datalist">
<datalist id="datalist">
<option>a</option>
<option>a</option>
<option>a</option>
</datalist>
</form>-->
<form>
<!--<input type="email">
<input type="tel">
<input type="url">
<input type="date">获取日期
<input type="color">获取颜色
<input type="search">
<input type="hidden" value="123">-->隐藏文本框
<input type="image" scr="1.png" width="40px">图片按钮
<input type="file" multiple>
</form>
</body>
</html>
<!--text单行文本框,value占位符 placeholder不占文本框的位置 maxlength最大能输入的字符-->
<input type="text" value="yyx">
<input type="text">
<input type="text" placeholder="yyx">
<input type="text" placeholder="maxlength" maxlength="8">
<input type="text" placeholder="yyx" size="50"><!--拓宽单行文本框-->
<input type="text" placeholder="yyx" readonly>只读
密码password
<input type="password" placeholder="password">
textarea多行文本框
<textarea rows="20" cols="8">yyx</textarea>
按钮
<input type="button" value="button">
<button>button</button> <!--js合作,并且作为绑定事件-->
<input type="submit" value="submit"><!--提交表单,获取用户输入的值-->
<!--数字滑动和手动输入数字-->
<input type="range" min="-100" max="100" step="100" value="0">
<input type="number" min="-100" max="100" value="0">
<input type="checkbox">
<input type="radio" name="a" checked>
<select>
<option>a</option>
<option>a</option>
<option>a</option>
</select>
<input type="text" list="datalist">
<datalist id="datalist">
<option>a</option>
<option>a</option>
<option>a</option>
</datalist>
</form>-->
<form>
<!--<input type="email">
<input type="tel">
<input type="url">
<input type="date">获取日期
<input type="color">获取颜色
<input type="search">
<input type="hidden" value="123">-->隐藏文本框
<input type="image" scr="1.png" width="40px">图片按钮
<input type="file" multiple>
</form>
- 嵌入图片和创建分区相应图
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>创建图片</title>
</head>
<body>
<!--<a href="idea1.html" target="_blank">
<img scr="1.png" alt="download button">
</a>-->
<img src="1.png" usemap="#map1">
<form>
<input type="1.png">
</form>
<!--创建客户端分区相应图-->
<map name="map1">
<area href="idea1.html" shape="rect" coords="38,62,175,200" target="_blank">
<area href="table.html" shape="rect" coords="227,62,364,200" target="_blank">
<area>
<area>
<area>
<area>
<area>
</map>
<!--<img scr="timg.jpg">
<img scr="1.png" width="128px" height="200px">
<img scr="1.png" alt="download button">-->
</body>
</html>