HTML5学习

初识HTML

1.

3.注释如何写

<!DOCTYPE html>
<html lang="en">

<!--  head标签代表网页头部-->
<head>
    <!--meta描述性标签,他用来描述我们网站的一些信息-->
    <!--meta一般用来做seo-->
    <meta charset="UTF-8">
    <meta name="keywords" content="朱曾冠">
    <meta name="description" content="来这个地方学java">

    <!--title网页标题-->
    <title>我的第一个网页</title>
</head>

<!--body标签代表网页主体-->
<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>

<!--段落标签-->

<p>两只老虎bai    两只老虎</p>
<p>跑得快       跑得快</p>
<p>真奇怪     真奇怪</p>
<p>真奇怪     真奇怪</p>
<p>真奇怪     真奇怪</p>
<!--水平线标签-->
<hr>
<!--换行标签-->
两只老虎     两只老虎<br/>
跑得快     跑得快<br/>
真奇怪真奇怪<br/>
真奇怪     真奇怪<br/>
真奇怪     真奇怪<br/>
<!--粗体,斜体-->
粗体: <strong>i love you</strong>
斜体:<em>i love you </em>
<br/>
<!--特殊符号-->
空  格:空&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp格
<br/>
&gt;
<br/>
&lt;
<br/>
&copy;版权所有
<!--特殊符号记忆方式
& ;
查百度也可
-->


</body>
</html>

图像标签

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>图像标签学习</title>
</head>
<body>
<!--img学习
src:图片地址
       相对地址,绝对地址
       ../  表示上一级目录
alt:图片名字(必填)

-->
<img src="../resourcess/image/1.jpg" alt="学习" title="悬停文字" width="300" height="300">

</body>
</html>

链接标签

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>链接标签学习</title>
</head>
<body>
<!--使用name做一个标记-->
<a name="top">顶部</a>
<!--a标签
先输入A 按tab直接生成
href:必填,表示要跳转到那个页面
网址前必须加上https
target:表示窗口在哪里打开
_blank  在新标签中打开
_self  在自己页面打开
-->
<a href="1.我的第一个网页.html" target="_blank">点击我跳转到页面</a>
<a href="https://www.baidu.com" target="_self">点击我跳转到页面</a>
<br>
<p><a href="1.我的第一个网页.html">
    <img src="../resourcess/image/1.jpg" alt="学习" title="悬停文字" width="300" height="300">
</a></p>
<p><a href="1.我的第一个网页.html">
    <img src="../resourcess/image/1.jpg" alt="学习" title="悬停文字" width="300" height="300">
</a></p>
<p><a href="1.我的第一个网页.html">
    <img src="../resourcess/image/1.jpg" alt="学习" title="悬停文字" width="300" height="300">
</a></p>



<br>
<!--锚链接
1.需要一个锚标记
2.跳转到标记
3.也可以从别的页面跳转到这个页面
#
-->
<a href="#top">回到顶部</a><br>
<a name="down">down</a><br>
<!--功能性链接
邮件:mailto;
QQ链接:QQ推广复制链接

-->
<a href="mailto:1234567789@qq.com">点击联系我</a>

</body>
</html>

行内元素和块元素

列表

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>列表学习</title>

</head>
<body>

<!--有序列表
应用范围:试卷,问答。。。
-->
<ol>
    <li>Java</li>
    <li>运维</li>
    <li>前端</li>
    <li>Java</li>
</ol>
<hr>
<!--无序列表
应用列表:导航,侧边栏

-->

<ul>
    <li>java</li>
    <li>jasad</li>
    <li>jdca</li>
    <li>asas</li>
    <li>asd</li>

</ul>
<hr>

<!--自定义列表
dl:标签
dt:列表名称
dd:列表内容

应用范围:
-->
<dl>
    <dt>学科</dt>
    <dd>java</dd>
    <dd>python</dd>
    <dd>C</dd>
    <dd>Linux</dd>

    <dt>位置</dt>
    <dd>北京</dd>
    <dd>上海</dd>
    <dd>广州</dd>

</dl>
</body>
</html>

表格

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>表格学习</title>

</head>
<body>
<!--表格table
行 tr  row
列 td
-->
<table border="1px">
    <tr>
        <!--colspan  跨列-->
        <td colspan="4">1-1</td>
    </tr>

    <tr>
        <!--colspan  跨行-->
        <td rowspan="2">2-1</td>
        <td>2-2</td>
        <td>2-3</td>
        <td>2-4</td>
    </tr>
    <tr>
        <td >3-1</td>
        <td>3-2</td>
        <td>3-3</td>
        <td>3-4</td>
    </tr>
</table>

<table border="1px">
    <tr>
        <td colspan="3" >&nbsp;&nbsp;&nbsp;&nbsp;学生成绩</td>
    </tr>
    <tr>
        <td rowspan="2">狂神</td>
        <td>语文</td>
        <td>100</td>
    </tr>
    <tr>
        <td>数学</td>
        <td>100</td>
    </tr>
    <tr>
        <td rowspan="2">秦疆</td>
        <td>语文</td>
        <td>100</td>


    </tr>
    <tr>
        <td>数学</td>
        <td>100</td>


    </tr>


</table>
</body>
</html>

视频和音频

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>媒体元素学习</title>
</head>
<body>

<!--音频和视频
src:资源路径
controls:控制条
autoplay:自动播放
(音频就把video换成 audio)

-->
<video src="../resourcess/video/2020-11-08_190053.mp4" controls></video>

</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>

iframe内联框架

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>iframe</title>
</head>
<body>
<!--iframe
src:地址
w-h:高度宽度
-->
<iframe src="https://www.baidu.com" name="hello" frameborder="0" width="1000px" height="800"></iframe>
<a href="https://www.bilibili.com"target="hello">点击跳转</a>

</body>
</html>

表单语法

表单初级验证

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>登陆注册</title>
</head>
<body>
<!--表单form
action:表单提交的位置,可以是网站,也可以是一个请求处理地址
method:post  get  提交方式
get:我们可以在url中看到我们提交的信息,不安全,但是高效
post:比较安全,传输大文件


-->

<h1>注册</h1>
<form action="1.我的第一个网页.html" method="post">
    <!--文本框:input type="text"
      value="XXX"  默认初始值
      maxlength = "8"  最长能写几个字符
      size="30"         文本框的长度
      placeholder   提示用户
       required     非空判断
      -->
    <p>名字:<input type="text" name="username" placeholder="请输入用户名" required></p>
    <!--密码框:input type="password"    -->
    <p>密码:<input type="password" name="pwd"></p>

<!--    单选框标签
input type="radio"
value: 单选框的值
name:表示组(在同一个组男和女才可以只选一个)

-->
    <p>
        <input type="radio" value="boy" name="sex">男
        <input type="radio" value="girl" name="sex">女</p>
<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">游戏

    </p>



<!--    按钮
input type="button"     普通按钮
input type="image"      图像按钮
input type="submit"     提交按钮
input type="reset"      重置
-->
    <p>按钮:
    <input type="button" value="点击变长" name="bt1">
<!--    <input type="image" src="../resourcess/image/1.jpg" width="80" height="80">-->

    </p>

<!--    下拉框,列表框

-->

    <p>国家:
        <select name="列表名称" id="">
            <option value="选项的值">中国</option>
            <option value="选项的值" selected>美国</option>
            <option value="选项的值">瑞士</option>
            <option value="选项的值">印度</option>

        </select>

    </p>

<!--    文本域
 rows="4" 行数4 cols="10"列数10
-->
    <p>反馈:
        <textarea name="textarea"  rows="4" cols="10" >文本内容</textarea>

    </p>

<!-- 文件域
-->
    <p>
        <input type="file" name="files">
        <input type="button" value="点击上传" name="upload">
    </p>

<!--    邮件验证-->
    <p>邮箱:
        <input type="email" name="email">
    </p>
<!--    url-->
    <p>URL:
        <input type="url" name="url">
    </p>
<!--    数字-->
    <p>商品数量:
        <input type="number" name="num" max="100" min="0" step="1">
    </p>
<!--    滑块-->
    <p>音量:
        <input type="range" name="voice" min="10" max="100" step="2">
    </p>
<!--    搜索框-->
    <p>搜索框:
        <input type="search" name="search">
    </p>

<!--    自定义邮箱-->
    <p>自定义邮箱
        <input type="text" name="diymail" pattern="/^([a-zA-Z]|[0-9])(\w|\-)+@[a-zA-Z0-9]+\.([a-zA-Z]{2,4})$/">
    </p>
    
    <input type="submit">
    <input type="reset" value="点击重置"></p>

    
</form>



</body>
</html>
posted @ 2020-11-28 22:21  不秃头的程序猿  阅读(182)  评论(0)    收藏  举报