html基础标签

小练习1

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

<head>
    <!--charset设置字符编码-->
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <!--keywords 搜索引擎可以搜索的关键字-->
    <meta name="keywords" content="html">
    <!--description 标题的描述-->
    <meta name="description" content="练习1">
    <title>小练习1</title>
    <!--跳转该网页时候的小图标-->
    <link rel="icon" href="/images/logo.png">
</head>

<body>
</body>

</html>

小练习2

<!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>web应用课程作业</title>
</head>

<body>
    <!-- 标题标签 -->
    <h2>春江花月夜</h2>
    <h5>张若虚</h5>
    <!-- p段落标签 br换行 -->
    <p>
        春江潮水连海平,海上明月共潮生。<br>
        滟滟随波千万里,何处春江无月明!<br>
        江流宛转绕芳甸,月照花林皆似霰;<br>
        空里流霜不觉飞,汀上白沙看不见。<br>
        江天一色无纤尘,皎皎空中孤月轮。<br>
        江畔何人初见月?江月何年初照人?<br>
        人生代代无穷已,江月年年望相似。
    </p>
    <!-- hr水平下划线 -->
    <hr>
    <!-- pre段落标签可以保留回车和空格 -->
    <pre>
        int main()
        {
            int a, b;
            scanf("%d%d", &a, &b);
            printf("%d %d\n", a, b);
            return 0;
        }
    </pre>
    <p>
        <!-- i表示斜体,b表示加粗 ,del表示删除线,ins表示下划线 -->
        <i>春眠不觉晓,</i><b>处处闻啼鸟。</b><del>夜来风雨声,</del><ins>花落知多少。</ins>
    </p>
    <p>
        <!-- mark标记成黄色 -->
        <mark>练习</mark>
        <!-- strong加粗 -->
        <strong>加粗</strong>
    </p>
</body>

</html>

小练习3

<!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>练习3</title>
</head>

<body>
    <!-- src表示图片的相对路径 ,
        alt表示当图片显示失败时显示的信息 
        width宽度:如果只设置宽度则高度会等比例压缩
        同理高度(height)也是
    -->
    <img width="600" src="/images/mountain.jpg" alt="">
</body>

</html>

小练习4

<!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>小练习4</title>
</head>

<body>
    <h1>audio</h1>
    <!-- 方式1:controls控制播放 src路径 -->
    <audio controls src="/audios/bgm.mp3">无法播放</audio>
    <!-- 方式2 假如第一个播放不了则播放第二个-->
    <audio controls>
        <source src="/audios/bgm.mp3" type="audio/mp3">
        <source src="/audios/bgm.mp3" type="audio/mp3">
    </audio>
    <h1>video </h1>
    <!-- 方式1  -->
    <video controls width="600" src="/videos/video2.mp4"></video>
    <!--方式2-->
    <video controls width="600">
        <source src="/videos/video2.mp4 " type="video/mp4">
        <source src="/videos/video2.mp4 " type="video/mp4">
    </video>
</body>

</html>

小练习5

<!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>小练习5</title>
</head>

<body>
    <!-- a 超链接标签 -->
    <h1>About</h1>
    <!--a标签内部可以嵌套标签,target表示在新页面打开此链接 没加的话默认当前页面打开超链接-->
    <a href="https://baidu.com" target="_blank"><img width="50px" src="/images/logo.png" alt="logo"></a>
    <a href="/about.html">About</a>
</body>

</html>

小练习6

<!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>小练习6</title>
</head>

<body>
    <h1>Form</h1>
    <!-- form表单标签 -->
    <form action="/login.html">
        <!-- text文本标签,label的for对应input的id 
            required是否必填
            minlength最小长度
            maxlength最大长度
            placeholder提示语句
        -->
        <label for="usename">用户名</label>
        <input type="text" name="usename" id="usename" required="true" minlength="3" maxlength="15" placeholder="用户名">
        <br>
        <!-- number数字标签 -->
        <label for="age">年龄</label>
        <input type="number" name="age" id="age" required="true" placeholder="年龄">
        <br>
        <!--email邮箱标签-->
        <label for="eamil">邮箱</label>
        <input type="email" name="email" id="email" required="true" placeholder="邮箱">
        <br>
        <label for="password">密码</label>
        <input type="password" name="password" id="password" required="true" placeholder="密码">
        <br>
        <label for="resume">个人简介</label>
        <!-- textarea多行 --rows行 cols列>
        <textarea name="resume" id="resume" placeholder="个人简历"></textarea>
        <br>
        <!-- 选择方式一select -->
        <label for="lang">语言</label>
        <select name="lang" id="lang">
            <option value="Cpp">Cpp</option>
            <option value="java">java</option>
            <option value="python">python</option>
        </select>
        <br>
        <!-- 方式二 radio ,单选选择项目的name要一样-->
        <label for="cpp">cpp</label>
        <input type="radio" name="lang2" id="cpp" value="cpp">
        <label for="java">java</label>
        <input type="radio" name="lang2" id="java" value="java">
        <label for="python">python</label>
        <input type="radio" name="lang2" id="python" value="python">
        <br>
        <!-- 上传文件 -->
        <input type="file">
        <!-- submit提交表单按钮 -->
        <input type="submit" value="提交">

    </form>
</body>

</html>

小练习7

<!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>小练习7</title>
</head>

<body>
    <h1>List</h1>
    <!-- 无序列表 -->
    <ol>
        <li>第一讲</li>
        <li>
            第二讲
            <ul>
                <li>第一小节</li>
                <li>第二小节</li>
                <li>第三小节</li>
            </ul>
        <li>
            第三讲
            <ol>
                <li>第一小节</li>
                <li>第二小节</li>
                <li>第三小节</li>
            </ol>
        </li>
        </li>
    </ol>
    <!-- 有序列表 -->
    <ol>
		<li></li>
    </ol>
     <!-- dl列表用于名词解释 -->
    <dl>
        <dt>不缩进</dt>
        <dd>缩进</dd>
    </dl>
</body>

</html>

小练习8

<!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>小练习8</title>
</head>

<body>
    <table>
        <h1>Table</h1>
        <!-- caption表的标题 -->
        <caption>成绩单</caption>
        <!-- thead会自动加粗表的第一行标题 -->
        <thead>
            <!-- tr表示行 -->
            <tr>
                <!-- th表示每行的单元格 -->
                <th>姓名</th>
                <th>数学</th>
                <th>语文</th>
                <th>英语</th>
            </tr>
        </thead>
        <!--  tbody主体部分-->
        <tbody>
            <tr>
                <th>Alice</th>
                <th>100</th>
                <th>99</th>
                <th>98</th>
            </tr>
            <tr>
                <th>Bob</th>
                <th>99</th>
                <th>98</th>
                <th>97</th>
            </tr>
            <tr>
                <th>Tom</th>
                <th>98</th>
                <th>97</th>
                <th>96</th>
            </tr>
        </tbody>
    </table>
</body>

</html>

小练习9

<!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>小练习9</title>
</head>

<body>
    <!-- 头部区域 -->
    <header>
        <h3>我的收藏夹</h3>
    </header>
    <!-- 导航区域 -->
    <nav></nav>
    <!--内容区域-->
    <section>
        <h4>图片</h4>
        <figure>
            <img width="100px" src="/images/logo.png">
            <!-- 图片解释 -->
            <figcaption>logo</figcaption>
        </figure>
        <figure>
            <img src="/images/logo.png" width="100px">
            <figcaption></figcaption>
        </figure>
    </section>
    <section>
        <h4>古诗</h4>
        <!-- 文章区域 -->
        <article>
            <h5>春晓</h5>
            <p>
                春眠不觉晓,<br>
                处处闻啼鸟。<br>
                夜来风雨声,<br>
                花落知多少。<br>
            </p>
        </article>
        <article>
            <h5>咏柳</h5>
            <p>
                碧玉妆成一树高,<br>
                万条垂下绿丝绦。<br>
                不知细叶谁裁出,<br>
                二月春风似剪刀。<br>
            </p>
        </article>
    </section>

    <!--右边区域-->
    <aside></aside>
    <!-- 底部区域 -->
    <footer>©2018-2022 Me 版权所有</footer>
</body>

</html>

小练习10

<!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>小练习10</title>
</head>

<body>
     <!--&copy;如下图  &lt:< &gt;> -->
    &copy;<Web>版权所有

</body>

</html>

在这里插入图片描述

  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

废材终结者

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值