HTML5知识点复习

第一个网页:

<!-- DOCTYPE:告诉浏览器,我们要使用什么规范 -->
<!DOCTYPE html>
<html lang="en">
<head>
    <!-- meta 描述性标签,它用来描述我们网站的一些信息
         meta 一般用来做SEO -->
    <meta charset="UTF-8">
    <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/>
    我有一所房子,面朝大海,春暖花开 <br/>

    <!-- 水平线标签 -->
    <hr/>

    <!-- 粗体,斜体 -->
    <h1>字体样式标签</h1>
    <strong>粗体 :i love you </strong>
    <em>斜体 :i love you </em>
    <br/>

    <!-- 特殊符号 -->
    空     格:
    空&nbsp;&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">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>图像标签学习</title>
</head>
<body>
    <!-- img学习
        src :图片地址
        相对地址,绝对地址
        ../ 代表上一级目录

        alt 
        两项必填

     -->
    <img src="./resource/image/垃圾分类小程序小区注册.png" alt="图片加载失败" title="悬停文字" width="300" height="300">
</body>
</html>

链接标签:

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

<head>
    <meta charset="UTF-8">
    <title>链接标签学习</title>
</head>

<body>
    <a name="top">顶部</a>
    <!-- a标签
         href : 必填,表示要跳转到的页面
         target : 表示窗口在哪里打开
               _blank : 在新标签中打开 
               _self : 在自己的网页打开-->
    <a href="3.图像标签.html" target="_blank">点击我跳转到页面三</a>
    <br />
    <a href="https://www.baidu.com" target="_self">点击我跳转到百度</a>

    <br />
    <a href="2.基本标签.html">
        <img src="./resource/image/ljfl_log.jpg" alt="图片加载失败" width="300" height="300">
    </a>

    <p>
        <a href="2.基本标签.html">
            <img src="./resource/image/ljfl_log.jpg" alt="图片加载失败" width="300" height="300">
        </a>
    </p>

    <p>
        <a href="2.基本标签.html">
            <img src="./resource/image/ljfl_log.jpg" alt="图片加载失败" width="300" height="300">
        </a>
    </p>

    <p>
        <a href="2.基本标签.html">
            <img src="./resource/image/ljfl_log.jpg" alt="图片加载失败" width="300" height="300">
        </a>
    </p>

    <p>
        <a href="2.基本标签.html">
            <img src="./resource/image/ljfl_log.jpg" alt="图片加载失败" width="300" height="300">
        </a>
    </p>

    <p>
        <a href="2.基本标签.html">
            <img src="./resource/image/ljfl_log.jpg" alt="图片加载失败" width="300" height="300">
        </a>
    </p>

    <p>
        <a href="2.基本标签.html">
            <img src="./resource/image/ljfl_log.jpg" alt="图片加载失败" width="300" height="300">
        </a>
    </p>





    <!-- 锚链接  可以跨页面链接
    1.需要一个锚标记
    2.跳转到标记-->
    <a href="#top">回到顶部</a>


    <!-- 功能性链接
    
    邮件链接:mailto:
    qq链接:-->

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




</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>列表学习</title>
</head>
<body>
    
    <!-- 有序列表 
    应用范围:试卷,问答 ....-->
    <ol>
        <li>Java</li>
        <li>Python</li>
        <li>C</li>
        <li>C++</li>
        <li>PHP</li>
    </ol>




    <!-- 无序列表
    应用范围:导航,侧边栏..... -->
    <ul>
        <li>Java</li>
        <li>Python</li>
        <li>C</li>
        <li>C++</li>
        <li>PHP</li>
    </ul>






    <!-- 自定义列表 
    dl:标签
    dt:列表名称
    dd:列表选项-->
    <dl>
        <dt>学科</dt>
        <dd>Java</dd>
        <dd>Python</dd>
        <dd>linux</dd>
        <dd>C</dd>

        <dt>位置</dt>
        <dd>西安</dd>
        <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
        列: td
     -->
    <table border="1px">
        <tr>
            <td colspan="3" align="center">学生成绩</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 src="" controls autoplay></video>

    <audio src="" controls autoplay></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>Document</title>
</head>

<body>
    <!-- iframe内联框架
    src : 地址
    w-h : 宽度高度-->
    <iframe src="https://www.baidu.com" name="hello" frameborder="0" width="1000px" height="800px"></iframe>

    <a href="1.第一个网页.html" target="hello">点击跳转</a>



    <!-- <iframe src="//player.bilibili.com/player.html?aid=55631961&bvid=BV1x4411V75C&cid=97256834&page=1" scrolling="no"
        border="0" frameborder="no" framespacing="0" allowfullscreen="true">
    </iframe> -->
</body>

</html>

表单学习(重要):

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

<head>
    <meta charset="UTF-8">
    <title>登陆注册</title>
</head>

<body>
    <h1>注册</h1>
    <!-- 表单form 
    action : 表单提交的位置 , 可以是网站,也可以是一个请求处理地址
    method : post,get 提交方式
            get方式提交:我们可以在url中看到我们提交的信息 , 不安全 , 高效
            post方式提交:比较安全,传输大文件
    value="请输入" : 默认初始值
    maxlength="8" :最长能写几个字符
    size="30" : 文本框的长度 -->
    <form action="1.第一个网页.html" method="POST">
        <!-- 文本输入框 input type = "text" 
        readonly 只读标签
        hidden : 隐藏(用于提交默认值)
        placeholder : 用于提示信息
        required : 非空判断 -->
        <p>名字:
            <input type="text" name="username" placeholder="请输入用户名" 
            required maxlength="8" size="30"></p>
        <!-- 密码框  input type="password" -->
        <p>密码:<input type="password" name="pwd"></p>

        <!-- 单选框标签
        input type = "radio"
        value : 单选框的值
        name : 表示组 
        disabled : 表示禁用-->
        <p>性别:
            <input type="radio" value="boy" name="sex"><input type="radio" value="girl" name="sex"></p>

        <!-- 多选框
        input type = "checkbox" 
        -->
        <p>爱好:
            <input type="checkbox" name="hobby" value="sleep">睡觉
            <input type="checkbox" name="hobby" value="code">敲代码
            <input type="checkbox" name="hobby" value="chat">聊天
            <input type="checkbox" name="hobby" value="game">打游戏
        </p>



        <!-- 按钮 
            input type="button" 普通按钮
            input type="image"  图像按钮
            input type="submit" 提交按钮
            input type="reset"  重置
            checked : 默认选中
        -->
        <p>按钮:
            <input type="button" name="btn1" value="点击变长">
            <!-- 图片按钮具备自动提交功能 -->
            <!-- <input type="image" src="./resource/image/timg.jpg" width="100" height="100"> -->
        </p>



        <!-- 下拉框 , 列表框
         -->

        <p>国家:
            <select name="列表名称">
                <option value="china">中国</option>
                <option value="us">美国</option>
                <option value="eth" selected>瑞士</option>
                <option value="india">印度</option>
            </select>
        </p>

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

        <!-- 文件域 
        input type="file" name="files"-->
        <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="10">
        </p>

        <!-- 滑块 -->
        <p>音量:
            <input type="range" name="voice" min="0" max="100" step="2">
        </p>

        <!-- 搜索框 -->
        <p>搜索:
            <input type="search" name="search">
        </p>

        <!-- 增强鼠标可用性 -->
        <label for="mark"> 你点我试试</label>
        <input type="text" id="mark">

        <!-- 正则表达式 -->
        <p>自定义邮箱:
            <input type="text" name="diymail" pattern="^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$">
        </p>

        <p>
            <input type="submit">
            <input type="reset" value="清空表单">
        </p>

    </form>
</body>

</html>
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值