课程表和注册表单实例

2023年01月17日 00:22:26阅读数:169博客 / 追梦赤子

课程表和注册表单实例

1. 课程表实例

  1. <!DOCTYPE html>
  2. <html lang="zh-CN">
  3. <head>
  4. <meta charset="UTF-8">
  5. <meta http-equiv="X-UA-Compatible" content="IE=edge">
  6. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  7. <title>课程表</title>
  8. </head>
  9. <body>
  10. <!--
  11. table是符合元素需多个标签进行描述
  12. 1. table:表格容器
  13. 2. caption: 表格标题
  14. 3. tr: 表格的行
  15. 4. td / th: 在tr内部,单元格;th常用于thead中,并且有加粗效果
  16. -->
  17. <table border="1" width="400">
  18. <caption>小学课程表</caption>
  19. <!-- 表头 -->
  20. <thead>
  21. <tr>
  22. <th>时间</th>
  23. <th>周一</th>
  24. <th>周二</th>
  25. <th>周三</th>
  26. <th>周四</th>
  27. <th>周五</th>
  28. </tr>
  29. </thead>
  30. <!-- 表体 -->
  31. <tbody>
  32. <tr>
  33. <td rowspan="3">上午</td>
  34. <td>数学</td>
  35. <td>语文</td>
  36. <td>语文</td>
  37. <td>数学</td>
  38. <td>英语</td>
  39. </tr>
  40. <tr>
  41. <!-- <td></td> -->
  42. <td>语文</td>
  43. <td>英语</td>
  44. <td>数学</td>
  45. <td>语文</td>
  46. <td>数学</td>
  47. </tr>
  48. <tr>
  49. <!-- <td></td> -->
  50. <td>语文</td>
  51. <td>美术</td>
  52. <td>计算机</td>
  53. <td>英语</td>
  54. <td>数学</td>
  55. </tr>
  56. <!-- 第五行 -->
  57. <tr>
  58. <td colspan="6">中午</td>
  59. <!-- <td></td> -->
  60. <!-- <td></td> -->
  61. <!-- <td></td> -->
  62. <!-- <td></td> -->
  63. <!-- <td></td> -->
  64. </tr>
  65. <tr>
  66. <td rowspan="3">下午</td>
  67. <td>科学</td>
  68. <td>数学</td>
  69. <td>体育</td>
  70. <td>音乐</td>
  71. <td>思品</td>
  72. </tr>
  73. <tr>
  74. <!-- <td></td> -->
  75. <td>数学</td>
  76. <td>语文</td>
  77. <td>语文</td>
  78. <td>数学</td>
  79. <td>英语</td>
  80. </tr>
  81. <tr>
  82. <!-- <td></td> -->
  83. <td>语文</td>
  84. <td>英语</td>
  85. <td>数学</td>
  86. <td>语文</td>
  87. <td>数学</td>
  88. </tr>
  89. </tbody>
  90. </table>
  91. </body>
  92. </html>

2. 注册表单实例

  1. <!DOCTYPE html>
  2. <html lang="zh-CN">
  3. <head>
  4. <meta charset="UTF-8">
  5. <meta http-equiv="X-UA-Compatible" content="IE=edge">
  6. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  7. <title>注册表单</title>
  8. </head>
  9. <body>
  10. <!-- form,fieldset,label,input,select+option,textarea,
  11. input+datalist+option,button -->
  12. <!-- 表单控件的容器 -->
  13. <form action="login.php" method="post">
  14. <!-- 表单控件分组容器 -->
  15. <fieldset>
  16. <legend>用户注册</legend>
  17. <div class="username">
  18. <label for="uname">账号:</label>
  19. <input type="text" name="username" placeholder="账号" id="uname" autofocus />
  20. </div>
  21. <br/>
  22. <div class="email">
  23. <label for="email">邮箱:</label>
  24. <input type="email" name="email" placeholder="邮箱" id="email" />
  25. </div>
  26. <br/>
  27. <div class="psw">
  28. <label for="psw">密码:</label>
  29. <input type="password" name="password" placeholder="******" id="password" />
  30. </div>
  31. <br/>
  32. <div class="age">
  33. <label for="age">年龄:</label>
  34. <input type="number" name="age" id="age" value="20" min="20" max="70" />
  35. </div>
  36. <br/>
  37. <div class="birthday">
  38. <label for="birthday">年龄:</label>
  39. <input type="date" name="birthday" id="birthday" min="1950-01-01" max="2003-01-20" />
  40. </div>
  41. <br/>
  42. <div class="url">
  43. <label for="blog">博客:</label>
  44. <input type="url" name="blog" id="blog" placeholder="http://baidu.com" />
  45. </div>
  46. <br/>
  47. <!-- 搜索框比文本框多一个清空按钮 -->
  48. <div class="search">
  49. <label for="keywords">搜索:</label>
  50. <input type="search" name="keywords" id="search" placeholder="输入关键字" />
  51. </div>
  52. <br/>
  53. <div class="hide">
  54. <input type="hidden" name="hide" value="hello,world!" />
  55. </div>
  56. <div class="upload">
  57. <label for="upload">头像:</label>
  58. <input type="file" name="user_pic" id="upload" accept="image/jpeg,image/png" />
  59. <button type="button">上传</button>
  60. </div>
  61. <br/>
  62. <div class="gender">
  63. <!-- for与默认值的input.id绑定 -->
  64. <label for="secret">性别:</label>
  65. <!-- name: 必须相同,以保住唯一性 -->
  66. <input type="radio" name="gender" value="male" id="male" /><label for="male"></label>
  67. <input type="radio" name="gender" value="female" id="female" /><label for="female"></label>
  68. <input type="radio" name="gender" value="secret" id="secret" checked /><label for="secret">保密</label>
  69. </div>
  70. <br/>
  71. <div class="hobby">
  72. <label>兴趣:</label>
  73. <input type="checkbox" name="hobby[]" value="game" id="game" checked /><label for="game">游戏</label>
  74. <input type="checkbox" name="hobby[]" value="book" id="book" /><label for="book">看书</label>
  75. <input type="checkbox" name="hobby[]" value="basketball" id="basketball" /><label for="basketball">篮球</label>
  76. </div>
  77. <br/>
  78. <div class="edu">
  79. <label for="edu">学历:</label>
  80. <select name="edu" id="edu" form="">
  81. <option value="" selected disabled>--请选择--</option>
  82. <option value="2">初中</option>
  83. <option value="3">高中</option>
  84. <option value="4">专科</option>
  85. <option value="5">本科</option>
  86. <option value="6">硕士</option>
  87. </select>
  88. </div>
  89. <br/>
  90. <div class="like">
  91. <label for="keyword">语言: </label>
  92. <input type="search" name="language" list="details" id="keyword" />
  93. <!-- 预置值列表 -->
  94. <!-- ? input.list 和 datalist.id 进行绑定 -->
  95. <datalist id="details">
  96. <option value="html">html</option>
  97. <option value="css">css</option>
  98. <option value="js">js</option>
  99. <option value="php">php</option>
  100. <option value="vue">vue</option>
  101. <option value="node">node</option>
  102. </datalist>
  103. </div>
  104. <br/>
  105. <div class="color">
  106. <label for="color">背景:</label>
  107. <input type="color" name="bgcolor" id="color" value="#ffff00" />
  108. </div>
  109. <br/>
  110. <div>
  111. <label for="comment">备注:</label>
  112. <textarea name="comment" id="comment" cols="30" rows="5" maxlength="200">
  113. Hello world
  114. </textarea>
  115. </div>
  116. <button type="submit">注册</button>
  117. </fieldset>
  118. </form>
  119. </body>
  120. </html>
批改状态:合格

老师批语:完成的很好,要是添加结果截图就完美了

版权申明:本博文版权归博主所有,转载请注明地址!如有侵权、违法,请联系admin@php.cn举报处理!

全部评论

文明上网理性发言,请遵守新闻评论服务协议

条评论
  • 博主信息
    追梦赤子
    博文
    7
    粉丝
    0
    评论
    0
    访问量
    745
    积分:0
    P豆:14