HTML:超文本标记语言 CSS:页面上的内容显示的风格(决定页面上内容的美观程度) javaScript:页面特效
html基础标签
html、head、title、meta、body、p、br、hr标签
<!DOCTYPE html>
<html>
<head>
<title>网页的标题</title>
<meta charset="UTF-8">
<meta name="keywrds" content="百度">
<meta name="description" content="百度">
</head>
<body>
hello world<br/><br/>
你好!
<hr/>
<p>这里是第一个段落</p>
<p>这里是第二个段落</p>
<p>这里是第三个段落</p>
</body>
</html>
图片标签img
<img src ="imgs/1.jpg" width="" height="" alt="这里是一张图片"/>
标题标签
<h1>标题一</h1>
<h2>标题二</h2>
<h3>标题三</h3>
<h4>标题四</h4>
<h5>标题五</h5>
<h6>标题六</h6>
列表ul和ol标签
成绩排行榜
<ol type="i" start="3">
<li>张三</li>
<li>李四</li>
<li>王五</li>
<li>赵六</li>
</ol>
公司人员名单
<ul type="circle">
<li>小红</li>
<li>小明</li>
<li>小张</li>
<li>小王</li>
</ul>
文本修饰标签和特殊符号
<b>王侯</b><i>将相</i><u>宁有种乎?</u>
<i><b>王侯</b>将相</i><u>宁有种乎?</u>
显示效果如下:
王侯将相宁有种乎? 王侯将相宁有种乎?
水分子的化学式:H<sub>2</sub>O
X的平方:X<sup>2</sup>
显示效果如下
水分子的化学式:H2O X的平方:X2
5<10
5>10
5≤10
5≥10
注册商标:®
版权符号:©
显示效果如下:
5<10
5>10
5≤10
5≥10
注册商标:? 版权符号:?
<span>
span标签的作用:将文字围起来,将来对其进行特殊处理
</span>
超链接
<a href="https:\www.baidu.com" target="_blank">百度一下</a>
<a href="https:\www.baidu.com">
<img src = "imgs/图片1.jpg" width="40">
</a>
<a name="top">顶部</a>
<a href="#top">回到顶部</a>
<a href="demo01.html#top">回到顶部</a>
<a href="mailto:123456@qq.com">点击联系我</a>
div表示层
<div style="color:#0000FF">
<h3>这是一个在 div 元素中的标题。</h3>
<p>这是一个在 div 元素中的文本。</p>
</div>
table表格标签
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title></title>
</head>
<body>
<table border="3" width="400" height="200" cellspacing="0" cellpadding="10">
<tr>
<th>姓名</th>
<th>班级</th>
<th>学号</th>
<th>成绩</th>
</tr>
<tr align="center">
<td>张三</td>
<td>3班</td>
<td>23</td>
<td>90</td>
</tr>
<tr align="center">
<td>李四</td>
<td>2班</td>
<td>21</td>
<td>89</td>
</tr>
</table>
</body>
</html>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>表格标签的学习</title>
</head>
<body>
<table border="1" cellspacing="0"cellpadding="4" width="600">
<tr>
<th>名称</th>
<th>单价</th>
<th>数量</th>
<th>小计</th>
<th>操作</th>
</tr>
<tr align="center">
<td>苹果</td>
<td>5</td>
<td>20</td>
<td>100</td>
<td><img src = "imgs/delete.jpg" width="15"></td>
</tr>
<tr align="center">
<td>菠萝</td>
<td rowspan="2">5</td>
<td>15</td>
<td>45</td>
<td><img src = "imgs/delete.jpg" width="15"></td>
</tr>
<tr align="center">
<td>香蕉</td>
<td>6</td>
<td>30</td>
<td><img src = "imgs/delete.jpg" width="15"></td>
</tr>
<tr align="center">
<td>总计</td>
<td colspan="4">175</td>
</tr>
</table>
</body>
</html>
表单标签
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>表单标签的学习</title>
</head>
<body>
<form action="demo04.html" method="post">
昵称:<input type="text" name="nickName" />
<br>
密码:<input type="password" / name="pwd">
<br>
性别:<input type="radio" name="gender" value="male"/>男
<input type="radio" name="gender" value="femle" checked/>女
<br>
爱好:<input type="checkbox" name="hobby" value="basketball"/>篮球
<input type="checkbox" name="hobby" value="sing" checked="checked"/>唱歌
<input type="checkbox" name="hobby" value="rap"/>rap
<br>
星座:<select>
<option value="1">金牛座</option>
<option value="2" selected">白羊座</option>
<option value="3">天蝎座</option>
<option value="4">天秤座</option>
<option value="5">射手座</option>
<option value="6">水瓶座</option>
</select>
<br>
备注:<textarea name="remark" rows="4" cols="50"></textarea>
<br>
<input type="submit" value="注册" />
<input type="reset" value="重置" />
<input type="button" value="这是一个普通按钮" />
</form>
</body>
</html>
显示效果如下
输入数据后提交转到demo04页面,右键检查,可以看见如下信息 搜索框滑块和简单验证
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>搜索框滑块和简单验证</title>
</head>
<body>
<p>邮箱:<input type="email" name="email"></p>
<p>URL:<input type="url" name="url"></p>
<p>数字:<input type="number" name="number" max="100" min="0"></p>
<p>滑动调整:<input type="range" name="voice" max="100" min="0"></p>
<p>搜索:<input type="search" name="search"></p>
<p><input type="submit" name="submit"></p>
</body>
</html>
表单的应用
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>搜索框滑块和简单验证</title>
</head>
<body>
<p>名字:<input type="text" name="username" value="admin" readonly></p>
<p>邮箱:<input type="email" name="email"></p>
<p>URL:<input type="url" name="url"></p>
<p>数字:<input type="number" name="number" max="100" min="0"></p>
<p>滑动调整:<input type="range" name="voice" max="100" min="0"></p>
<p>搜索:<input type="search" name="search"></p>
<p><input type="submit" name="submit"></p>
<p>性别:<input type="radio" name="gender" value="male" checked disabled/>男
<input type="radio" name="gender" value="femle" checked/>女</p>
隐藏属性<input type="text" hidden>
<p>
<label for="mark">点击</label>
<input type="text"id="mark">
</p>
</body>
</html>
表单初级验证
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>简单验证</title>
</head>
<body>
<form action="https://www.baidu.com" method="post">
<p>名字:<input type="text" name="username" placeholder="请输入名字"></p>
<p>邮箱:<input type="email" name="email" required></p>
<p>URL:<input type="url" name="url" pattern=""></p>
<p>数字:<input type="number" name="number" max="100" min="0"></p>
<p>滑动调整:<input type="range" name="voice" max="100" min="0"></p>
<p>搜索:<input type="search" name="search"></p>
<p><input type="submit" name="submit"></p>
<p>性别:<input type="radio" name="gender" value="male" checked disabled/>男
<input type="radio" name="gender" value="femle" checked/>女</p>
隐藏属性<input type="text" hidden>
<p>
<label for="mark">点击</label>
<input type="text"id="mark">
</p>
</form>
</body>
</html>
frameset 和 iframe 标签
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title></title>
</head>
<frameset rows="20%,*">
<frame src="frames/top.html"/>
<frameset cols="15%,*">
<frame src="frames/left.html"/>
<frameset rows="80%,*">
<frame src="frames/main.html"/>
<frame src="frames/botton.html"/>
</frameset>
</frameset>
</frameset>
</html>
新建的五个页面在一个页面中显示
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title></title>
</head>
<body>
<iframe src="frames/top.html"></iframe>
</body>
</html>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>iframe</title>
</head>
<body>
<iframe src="https://www.baidu.com" frameborder="0"width="200"height="200" ></iframe>
<iframe src anme="hello" frameborder="0" width="200" height="200"></iframe>
<a href="demo01.html" target="hello">点击跳转</a>
</iframe>
</body>
</html>
媒体元素
如何在网页中播放音频和视频文件,
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>媒体元素学习</title>
</head>
<body>
<video src="video/1.mp4" controls autoplay></video>
<br/>
<audio src="audio/大笨钟 - 周杰伦.mp3" controls autoplay></audio>
</body>
</html>
页面结构分析
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>页面结构分析</title>
</head>
<body>
<header>
<h1>网页头部</h1>
</header>
<section>
<h2>页面主体</h2>
</section>
<footer>
<h2>页面脚部</h2>
</footer>
</body>
</html>
|