Hyper Text Markup Language ( 超文本标记语言 )
超文本包括:文字、图片、音频、视频、动画等;
DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="keywords" content="苗半里的博客">
<meta name="description" content="来学Java">
<title>我的第一个网页title>
head>
<body>
Hello World !
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>
接下来是换行<br>再换行<br>再换<br>
<hr/>
<h1>字体样式标签h1>
<strong>粗体strong>
<em>斜体em>
哈 哈
<br/>>
<br/><
©苗半里版权所有
body>
html>
DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>图像标签学习title>
head>
<body>
<img src="../../resource/image/1.png" alt="图像标签使用讲解">
<img src="../../resource/image/1.png" alt="图像标签使用讲解" title="悬停文字" width="1000">
body>
html>
有 文本超链接 和 图像超链接 :
DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>链接标签title>
head>
<body>
<a href="http://www.baidu.com" target="_blank">点击我跳转到百度a>
<br>
<a href="http://www.baidu.com">
<img src="https://baidu.png" alt="百度">
a>
<a name="top">顶部a>
<a href="#top">回到顶部a>
<a href="mailto:[email protected]">点击给我发邮件a>
body>
html>
什么是列表?
列表就是信息资源的一种展示形式,可以使信息结构化和条理化,以便浏览者快捷地获取相应信息。
列表的分类:
DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>列表title>
head>
<body>
<ul>
<li>网页li>
<li>数据库li>
<li>算法li>
ul>
<hr/>
<ol>
<li>Javali>
<li>C++li>
<li>Pythonli>
ol>
<hr/>
<dl>
<dt>编程dt>
<dd>Javadd>
<dd>C++dd>
<dd>Pythondd>
<dt>业务dt>
<dd>前端dd>
<dd>后端dd>
dl>
body>
html>
为什么使用表格?
基本结构:
DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>表格title>
head>
<body>
<table border="1px">
<tr>
<td> 1-1 td>
<td> 1-2 td>
<td> 1-3 td>
<td> 1-4 td>
tr>
<tr>
<td> 2-1 td>
<td> 2-2 td>
<td> 2-3 td>
<td> 2-4 td>
tr>
<tr>
<td rowspan="2"> 3-1 td>
<td> 3-2 td>
<td> 3-3 td>
<td colspan="3"> 3-4 td>
tr>
<tr>
<td> 4-1 td>
<td> 4-2 td>
<td> 4-3 td>
<td> 4-4 td>
tr>
table>
body>
html>
video 和 audio 标签 (可自由加属性):
DOCTYPE html>
<hmtl>
<head>
<meta charset="UTF-8">
<title>媒体元素title>
head>
<body>
<video src="../../resource/video/VID_20221226_195327.mp4" controls autoplay>video>
<audio src="../../resource/audio/bbox.wav" controls autoplay>audio>
body>
hmtl>
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>内联框架title>
head>
<body>
<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="https://www.csdn.net/" frameborder="0" width="100px" height="200px">iframe>
<iframe src="" name="hello" frameborder="0">iframe>
<a href="第一个网页.html" target="hello">点击跳转a>
body>
html>
例如网页里的用户登录窗口就是一个表单
DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>登录注册title>
head>
<body>
<h1>注册h1>
<form action="第一个网页.html" method="get">
<p>名字:<input type="text" name="username">p>
<p>密码:<input type="password" name="pwd">p>
<p>
<input type="submit">
<input type="reset">
p>
form>
body>
html>
DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>登录注册title>
head>
<body>
<h1>注册h1>
<form action="第一个网页.html" method="get">
<p>名字:<input type="text" name="username" value="请输入用户名" maxlength="8" size="30">p>
<p>密码:<input type="password" name="pwd">p>
<p>性别:
<input type="radio" value="boy" name="sex"/>男
<input type="radio" value="girl" name="sex"/>女
p>
<p>爱好:
<input type="checkbox" value="sleep" name="hobby">睡觉
<input type="checkbox" value="code" name="hobby" checked>敲代码
<input type="checkbox" value="chat" name="hobby">聊天
<input type="checkbox" value="game" name="hobby">游戏
<input type="checkbox" value="sport" name="hobby">运动
p>
<p>按钮:
<input type="button" name="btnl" value="点我验证">
<input type="image" src="../../resource/image/img.png">
p>
<p>国家
<select name="列表名称" >
<option value="china" selected>中国option>
<option value="us">美国option>
<option value="uk">英国option>
select>
p>
<p>反馈:
<textarea name="textarea" cols="40" rows="3" >文本内容textarea>
p>
<p>
<input type="submit">
<input type="reset">
p>
<p>上传文件:
<input type="file" name="files">
<input type="button" value="上传" name="upload">
p>
<p>邮箱:
<input type="email" name="email">
p>
<p>URL
<input type="url" name="url">
p>
<p>数量:
<input type="number" name="num" max="100" min="0" step="10">
p>
<p>音量:
<input type="range" name="voice" min="0" max="100" step="1">
p>
<p>搜索:
<input type="search" name="search">
p>
form>
body>
html>
拓展:
<label for="mark">你点我试试label>
<input type="text" id="mark">
常用方式:
<p>名字:<input type="text" name="username" placeholder="请输入用户名" required>p>
<p>密码:<input type="password" name="pwd">p>
<p>自定义邮箱:
<input type="text" name="diymail"
pattern="[\\w!#$%&'*+/=?^_`{|}~-]+(?:\\.[\\w!#$%&'*+/=?^_`{|}~-]+)*@(?:[\\w](?:[\\w-]*[\\w])?\\.)+[\\w](?:[\\w-]*[\\w])?">
p>