1.什么是HTML
HTML:Hyper Text Markup Language(超文本标记语言)
W3C:
World Wide Web Consortium
成立于1994年,Web技术领域最权威和具影响力的国际中立性技术标准机构
http://www.w3.org/
http://www.chinaw3c.org/
w3C标准包括
结构化标准语言(HTML、XML)
表现标准语言(Css)
行为标准(DOM、ECMAScript )
常见IDE
DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="keywords" content="狂神说Java">
<meta name="description" content="学习Java">
<title>Titletitle>
head>
<body>
<h1> 狂神h1>
body>
html>
DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>基本标签学习title>
head>
<body>
<h1>一级标签h1>
<h2>二级标签h2>
<h3>三级标签h3>
<h4>四级标签h4>
<h5>五级标签h5>
<h6>六级标签h6>
<p>跑得快跑得快p>
<p>一只没有耳朵p>
<p>一只没有尾巴p>
<p>真奇怪真奇怪p>
<p>两只老虎两只老虎p>
<hr/>
跑得快跑得快<br/>
一只没有耳朵<br/>
一只没有尾巴<br/>
真奇怪真奇怪<br/>
两只老虎两只老虎<br/>
<p>粗体:<strong>i love youstrong>p>
<p>斜体:<em>i love youem>p>
<br/>
<p>空格: 空格p>
<p>空格: 空格p>
<p>>p>
<p><p>
<p>©版权所有符号p>
<br/>
<hr/>
body>
html>
DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>3.图片标签学习title>
head>
<body>
<img src="../images/善逸子.jpg" alt="图像代替文字" title="悬停提示" width="1000" height="600">
body>
html>
DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>链接标签学习title>
head>
<body>
<a name="top">顶部a>
<a href="#down">downa>
<a href="1.我的第一个网页标签.html" target="_blank">第一个网页标签a>
<a href="2.基本标签.html" target="_self">基本标签a>
<a href="3.图片标签.html">图片标签a>
<br/>
<a href="3.图片标签.html">
<img src="../images/善逸子.jpg" alt="善逸子" title="我妻善逸" width="100" height="60">
a>
<div>
<p>
<a href="3.图片标签.html">
<img src="../images/善逸子.jpg" alt="善逸子" title="我妻善逸" width="100" height="60">
a>
p>
<p>测试方便可以多放几张图片p>
div>
<a href="#top">回到顶部a>
<a name="down">底部a>
<a href="mailto:你的邮箱地址">点击联系我a>
<a target="_blank" href="http://wpa.qq.com/msgrd?v=3&uin=你的qq号&site=qq&menu=yes">
<img border="0" src="../images/善逸子.jpg"
alt="点击联系我" title="点击联系我" width="100" height="60"/>
a>
body>
html>
DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>5.列表学习title>
head>
<body>
<ol>
<li>Javali>
<li>Pythonli>
<li>运维li>
<li>前端li>
<li>C/C++li>
ol>
<hr/>
<li>Javali>
<li>Pythonli>
<li>运维li>
<li>前端li>
<li>C/C++li>
<hr/>
<ul>
<li>Javali>
<li>Pythonli>
<li>运维li>
<li>前端li>
<li>C/C++li>
ul>
<dl>
<dt>学科dt>
<dd>Javadd>
<dd>数据结构dd>
<dd>数据分析dd>
<dd>数据库dd>
<dt>位置dt>
<dd>广州dd>
<dd>深圳dd>
dl>
body>
html>
DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>6.表格学习title>
head>
<body>
<table border="1px">
<tr>
<td colspan="4">1-1td>
<td>1-2td>
tr>
<tr>
<td rowspan="2">2-1td>
<td>2-2td>
<td>2-3td>
<td>2-4td>
<td>2-5td>
tr>
<tr>
<td>3-1td>
<td>3-2td>
<td>3-3td>
<td>3-4td>
tr>
table>
<br>
<hr/>
<br>
<table border="2px" cellspacing="0">
<tr>
<td colspan="3" align="center">学生成绩td>
tr>
<tr>
<td rowspan="2">狂神td>
<td>语文td>
<td>100td>
tr>
<tr>
<td>数学td>
<td>100td>
tr>
<tr>
<td rowspan="2">秦疆td>
<td>语文td>
<td>100td>
tr>
<tr>
<td>数学td>
<td>100td>
tr>
table>
body>
html>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>7.媒体元素学习</title>
</head>
<body>
<!--音频和视频
src : 资源路径
controls : 控制条
autoplay : 自动播放
-->
<video src="本地视频地址" controls autoplay></video>
<audio src="../audio/CelloNaduo - 风居住的街道(大提琴版).mp3" controls></audio>
</body>
</html>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>页面结构学习</title>
</head>
<body>
<header>
<h2>网页头部</h2>
</header>
<section>
<h2>网页主体</h2>
</section>
<footer>
<h2>网页脚部</h2>
</footer>
</body>
</html>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>内联框架iframe学习</title>
</head>
<body>
<!--iframe 内联框架
src: 地址
w-h: 宽度高度
-->
<!--<iframe src="http://taobao.com" frameborder="0" width="800px" height="600px">-->
<!--</iframe>-->
<!--<iframe src="//player.bilibili.com/player.html?aid=55631961&bvid=BV1x4411V75C&cid=97257967&page=11"
scrolling="no" border="0" frameborder="no" framespacing="0" allowfullscreen="true"> </iframe>-->
<iframe src="" name="hello" frameborder="0" width="800px" height="600px"></iframe>
<a href="3.图片标签.html" target="hello">点击跳转</a>
</body>
</html>
这里的name="name"和name=“pass”是属性,用于后端取值(对应实体类)
<form action="1.我的第一个网页标签.html" method="post">
<p>名字:<input type="text" name="username">p>
<p>密码:<input type="password" name="password">p>
<p>性别:
<input type="radio" value="boy" name="sex" checked/>小哥哥
<input type="radio" value="girl" name="sex"/>小姐姐
p>
<p>爱好:
<input type="checkbox" value="sleep" name="hobby">睡觉
<input type="checkbox" value="code" name="hobby">敲代码
<input type="checkbox" value="study" name="hobby" checked>学习
<input type="checkbox" value="reading" name="hobby">阅读
<input type="checkbox" value="game" name="hobby">游戏
p>
<p>按钮:
<input type="button" name="btn1" value="点击">
p>
<p>国家:
<select name="Country">
<option value="China" >中国option>
<option value="Switzerland" selected>瑞士option>
<option value="England">英国option>
<option value="France">法国option>
select>
p>
<p>反馈:
<textarea name="textarea" cols="50" rows="10">文本内容textarea>
p>
<input type="file" name="files">
<input type="button" value="上传" name="upload">
16. 简单验证和搜索框、滑块
<p>邮箱:
<input type="email" name="email">
p>
<p>网址:
<input type="url" name="url">
p>
<p>商品数量:
<input type="number" name="num" max="100" min="0" step="1"/>
p>
<p>音量 :
<input type="range" min="0" max="100" step="2" name="voice"/>
p>
<p>搜索:
<input type="search" name="search">
p>
<p>
<input type="submit">
<input type="reset" value="清空表单">
p>
<p>密码:<input type="password" name="password" hidden value="123456">p>
只读:readonly
<p>名字:<input type="text" name="username" value="admin" readonly>p>
禁用:disabled
<p>性别:
<input type="radio" value="boy" name="sex" checked disabled/>小哥哥
<input type="radio" value="girl" name="sex"/>小姐姐
p>
label 标签
<p>
<label for="mark">点击有惊喜
<input type="text" id="mark">
label>
p>
<p>名字:<input type="text" name="username" placeholder="请输入用户名">p>
<p>反馈:
<textarea name="textarea" cols="50" rows="10" placeholder="请输入文本内容">textarea>
p>
required: 非空判断,必须要用户填写的信息,可以用上required
<p>名字:<input type="text" name="username" placeholder="请输入用户名" required>p>
<p>密码:<input type="password" name="password" placeholder="请输入密码" required>p>
pattern:正则表达式
<p>自定义邮箱:
<input type="text" name="diymail" pattern="\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*">
p>