HTML常用知识点代码
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>test</title>
</head>
<body>
<h1 id="h1">h1</h1>
<h2 id="h2">h2 <a href="#h1">返回顶部</a></h2>
<h3>h3</h3>
<h4>h4</h4>
<h5>h5</h5>
<h6>h6</h6>
强制<br />换行的单标签
<p>paragraph</p>
<p>paragraph1</p>
<strong>加粗</strong>
<b>加粗</b>
<em>倾斜</em>
<i>倾斜</i>
<del>删除</del>
<s>删除</s>
<ins>下划线</ins>
<u>下划线</u>
<div>div独占一行,块级元素</div>
<span>一行有多个span,行内元素</span>
<span>一行有多个span,行内元素</span>
<h4>图片 src alt title </h4>
<img src="Oreo.jpg" alt="图片显示有误时用文字替换" title="奥利奥" >
<h4>超链接 必须要以http开头,_blank为在新标签页打开目标网址, _self为在原标签页打开,默认为_self</h4>
<a href="http://www.baidu.com" target="_blank">百度</a>
<a href="test.html" target="_blank">体育新闻</a>
<a href="#" target="_self">空链接</a>
<h4>下载链接:如果href中里面的地址是一个文件 .exe或者压缩包.zip,会下载这个文件</h4>
<h4>网页元素的链接</h4>
<a href="http://www.baidu.com"><img src="Oreo.jpg"></a>
<h4>锚点链接:点击链接,可以快速定位到页面中的某个位置</h4>
<a href="#h2">h2(用#使用id管理器)</a>
<pre>1 2</pre>
1 2
<table align="center" border="1px" cellpadding="30px" cellspacing="0px">
<thead>
<tr>
<th>属性名</th>
<th>属性值</th>
<th>描述</th>
</tr>
</thead>
<tr >
<td>align</td>
<td>left、center、right</td>
<td>规定表格相对周围元素的对齐方式</td>
</tr>
<tr>
<td>border</td>
<td>1或“”</td>
<td>规定表格单元是否拥有边框,默认为“”,即没有边框</td>
</tr>
<tr>
<td>cellpadding</td>
<td>像素值</td>
<td>规定单元边沿及其内容之间的空白,默认为1像素</td>
</tr>
<tr>
<td>cellspacing</td>
<td>像素值</td>
<td>规定单元格之间的空白,默认2像素</td>
</tr>
<tr>
<td>width</td>
<td>像素值或百分比</td>
<td>规定表格的宽度</td>
</tr>
<tr>
<td rowspan="2"></td>
<td></td>
<td></td>
</tr>
<tr>
<td colspan="2"></td>
</tr>
</table>
<ul>
<li>无序列表<a href="http://www.baidu.com">baidu</a></li>
<li>1</li>
<li>1</li>
<li>1</li>
</ul>
<li>lue</li>
<ol>
<li>有序列表</li>
<li>1</li>
<li>2</li>
<li>3</li>
</ol>
<dl>
<dt>自定义列表标题</dt>
<dd>内容</dd>
<dd>内容</dd>
<dd>内容</dd>
</dl>
<form action="url地址" method="POST" name="1">
<input type="text" name="name" id="1" maxlength="6"> <br>
<label>
密码:<input type="password">
</label>
<br>
1<input type="radio" name="2">
2<input type="radio" name="2" checked><br>
1<input type="checkbox" name="1">
2<input type="checkbox" name="1">
3<input type="checkbox" name="1"><br>
<input type="reset" value="重置"><br>
<input type="submit" value="提交"><br>
文件上传<input type="file"><br>
</form>
<select>
<option value="" selected>请选择</option>
<option value="">湖南</option>
<option value="">湖北</option>
<option value="">贵州</option>
<option value="">太空</option>
<option value="">月球</option>
<option value="">冥王星</option>
</select>
</body>
</html>