博客列表 >html常用标签学习-2019年1月14日22点52分

html常用标签学习-2019年1月14日22点52分

kszyd的博客
kszyd的博客原创
2019年01月16日 14:18:01631浏览

这段代码主要是对熟悉html常用标签。

实例

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>标签练习</title>
</head>
<body style="height:2000px;">
      <div>
         <h1>标签练习标题与段落</h1>
         <h2>标签练习标题与段落</h2>
         <h3>标签练习标题与段落</h3>
         <p>段落1</p>
         <p>段落2</p>
      </div>
      <hr>
      <!-- 文本修饰标签:主要针对段落或文本内某一部分进行修饰,针对局部部分 -->
      <div>
          <p>你好 <strong style="background-color:aquamarine">2019</strong></p>
      </div>
      <hr>
      <!-- 列表:将一组有共同特征的东西放到一起 -->
      <div>
          <p>购物清单</p>
      <!-- ul 无序列表 -->
          <ul>
              <li>1.暖手宝一个,30元,天太冷</li>
              <li>2.笔记本电脑,3000元,学习</li>
          </ul>
          <ol>
            <li>暖手宝一个,30元,天太冷</li>
            <li>笔记本电脑,3000元,学习</li>
        </ol>
        <dl>
            <dt>dt代表一个标题</dt>
            <dd>解释</dd>
        </dl>
      </div>
      <hr>
      <!-- 表格 -->
      <table border="2" cellpadding="5">
          <caption>购物车</caption>
          <thead>
            <tr>
                <th>序号</th>
                <th>名称</th>
                <th>价格</th>
                <th>用途</th> 
            </tr>
          </thead>

          <tbody>
            <tr>
                <td>1</td>
                <td>暖手宝</td>
                <td>30元</td>
                <td>天冷</td>
            </tr>
            <tr>
                <td>2</td>
                <td>电脑</td>
                <td>3000元</td>
                <td>学习</td>
            </tr>
          </tbody>
      </table>
      <hr>
      <h2>用户注册</h2>
      <form action="check.php" method="GET">
          <div>
              <label for="username">用户名:</label>
              <input type="text" id="username" name="username" value="" placeholder="用户名不能少于5位">
          </div>
          <div>
              <label>密码:<input type="password" name="password"></label>
          </div>
              <label>确认密码:<input type="password" name="password"></label>
          </div>

          <div>
              <input type="radio" name="gender" value="male" id="male"><label for="male">男</label>
              <input type="radio" name="gender" value="female" id="female"><label for="female">女</label>
          </div>
          <div>
              <input type="checkbox" name="hobby[]" value="game" id="game"><label for="game">打游戏</label>
              <input type="checkbox" name="hobby[]" value="smoke" id="smoke"><label for="smoke">抽烟</label>
              <input type="checkbox" name="hobby[]" value="bianc" id="bianc"><label for="bianc">编程</label>
          </div>
          <div>
                <label for="edu">学历:</label>
                <select name="edu" id="edu" value="2">
                      <option value="1">小学</option>
                      <option value="2">中学</option>
                </select>
            </div>
            <div>
                <label for="liuy">留言</label>
                <textarea name="liuy" id="liuy" cols="30" rows="10" placeholder="不超过50字"></textarea>
            </div>
            <input type="submit" value="注册">
            <button type="button">提交</button>
      </form>
      <img src="static/images/img1.jpg" alt="2019你好" width="300">  
      <video src="static/images/test.mp4" controls="controls"></video>  
</body>
</html>

运行实例 »

点击 "运行实例" 按钮查看在线实例

主要是标题与段落标签、列表、表格、控件、表单等内容。

声明:本文内容转载自脚本之家,由网友自发贡献,版权归原作者所有,如您发现涉嫌抄袭侵权,请联系admin@php.cn 核实处理。
全部评论
文明上网理性发言,请遵守新闻评论服务协议