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>Document</title>
</head>
<body>
</body>
</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>Document</title>
</head>
<body>
<h1>一级标题</h1>
<h2>二级标题</h2>
<h3>三级标题</h3>
<h4>四级标题</h4>
</body>
</html>
常用标签:
- 段落标签:p
- 强制换行:br
- div(division)/span(跨度),可以把图片或文字放在里面
- div:独占一行(属于块级元素)
- span:一行可以放多个span(属于行内元素)
- 加粗标签:strong或b
- 倾斜标签:em或b
- 删除线:del或s
- 下划线:ins或u
- 空格: 
- 大于号(less than):<
- 小于号(greater than):>
图片插入:
可以使用相对路径,也可以使用绝对路径,也可以链接到某网站的链接
../pic.png代表链接到上一级路径的pic图片(../代表上一级路径)
img/pic.png代表下一级img路径的pic图片(/代表下一级路径)
当然也可以使用绝对路径值
<!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>Document</title>
</head>
<body>
<img src="C:\Users\64516\Desktop\first.png" alt="" title="" border="15">
</body>
</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>Document</title>
</head>
<body>
<a href=""></a>
<a href="http://www.qq.com" target="">跳转到腾讯</a>
<a href="http://www/baidu.com"><img src="/img/first.png" alt="加载失败"></a>
<a href="html006.html" target="_blank">跳转到html006</a>
<a href="../首页.png">首页</a>
<a href="#">空链接</a>
<a href="/img/first.zip">download</a>
<br><br><br><br><br><br>
<a href="#experience"><h1>早年经历</h1></a>
<p>这里是一大段文本内容</p>
<a href="#back" id=experience><h2>早年经历</h2></a>
<p>这里是一大段文本内容</p>
</body>
</html>
table标签:
- tr代表行,td代表列,td嵌套在tr中
- th可以替代tr作为表头行,效果是居中加粗
- 后期效果我们一般在css中实现
<!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>Document</title>
</head>
<body>
<table border="1" cellspacing="5" width="400">
<tr><th>姓名</th><th>年龄</th></tr>
<tr align="center"><td>陈星宇</td><td>20</td></tr>
<tr align="center"><td>cxy</td><td>20</td></tr>
</table>
</body>
</html>
- 我们一般把表格的表头和其它内容分别放在thead和tbody中
<!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>Document</title>
</head>
<body>
<table border="1" cellspacing="0" align="center" width="400">
<thead>
<tr><th>排名</th><th>关键词</th><th>趋势</th><th>今日搜索</th><th>最近七日</th><th>相关链接</th></tr>
</thead>
<tbody>
<tr align="center"><td>1</td><td>鬼吹灯</td><td><img src="" alt="未加载"></td><td>345</td><td>123</td><td><a href="http://www.baidu.com">百度</a> <a href="http:www.qq.com">qq</a></td></tr>
<tr align="center"><td>1</td><td>鬼吹灯</td><td><img src="" alt="未加载"></td><td>345</td><td>123</td><td><a href="http://www.baidu.com">百度</a> <a href="http:www.qq.com">qq</a></td></tr>
<tr align="center"><td>1</td><td>鬼吹灯</td><td><img src="" alt="未加载"></td><td>345</td><td>123</td><td><a href="http://www.baidu.com">百度</a> <a href="http:www.qq.com">qq</a></td></tr>
</tbody>
</table>
</body>
</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>Document</title>
</head>
<body>
<table border="1" cellspacing="5" width="400">
<tr><th>姓名</th><th>年龄</th><th>职业</th></tr>
<tr align="center"><td>陈星宇</td><td colspan="2">20</td></tr>
<tr align="center"><td rowspan="2">cxy</td><td>20</td><td>教师</td></tr>
<tr align="center"><td>20</td><td>wwws</td></tr>
</table>
</body>
</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>Document</title>
</head>
<body>
<dl>
<dt>关注我们</dt>
<dd>微信</dd>
<dd>微博</dd>
<dd>b站</dd>
</dl>
</body>
</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>Document</title>
</head>
<body>
<form action="" method="" name="">
</form>
<form action="">
<input type="text" maxlength="7"><br>
<input type="password" name="pwd"><br>
🚹<input type="radio" name="gender" id="" value="male" checked=checked>
🚺<input type="radio" name="gender" id="" value="famele">
<br>
爱好:<input type="checkbox" name="hobby" value="playgame" checked=checked>
打游戏
<br>
<input type="submit" name="" id="" value="注册">
<input type="reset" name="" id="">
<input type="button" name="" id="" value="button">
<input type="file" name="" id="">
<label for="male">男性</label><input type="radio" name="gender" id="male">
<label for="famele">女性</label><input type="radio" name="gender" id="famele">
</form>
<form action="">
籍贯
<select name="" id="">
<option value="北京">北京</option>
<option value="山东">山东</option>
<option value="地球" selected=selected>地球</option>
</select>
</form>
<form action="">
<textarea name="" id="" cols="30" rows="10">
我最帅!
</textarea>
<input type="reset" name="" id="">
</form>
</body>
</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>Document</title>
</head>
<body>
<form action="" method="" name="">
</form>
<form action="">
<input type="text" maxlength="7"><br>
<input type="password" name="pwd"><br>
🚹<input type="radio" name="gender" id="" value="male" checked=checked>
🚺<input type="radio" name="gender" id="" value="famele">
<br>
爱好:<input type="checkbox" name="hobby" value="playgame" checked=checked>
打游戏
<br>
<input type="submit" name="" id="" value="注册">
<input type="reset" name="" id="">
<input type="button" name="" id="" value="button">
<input type="file" name="" id="">
<label for="male">男性</label><input type="radio" name="gender" id="male">
<label for="famele">女性</label><input type="radio" name="gender" id="famele">
</form>
<form action="">
籍贯
<select name="" id="">
<option value="北京">北京</option>
<option value="山东">山东</option>
<option value="地球" selected=selected>地球</option>
</select>
</form>
<form action="">
<textarea name="" id="" cols="30" rows="10">
我最帅!
</textarea>
<input type="reset" name="" id="">
</form>
</body>
</html>