PHP8.1.21版本已发布
vue8.1.21版本已发布
jquery8.1.21版本已发布

博客列表 > 课程表、用户注册及 css 预习

课程表、用户注册及 css 预习

Ghcᝰ
Ghcᝰ 原创
2021年03月21日 21:23:55 410浏览

课程表、用户注册及 css 预习

  • 课程表效果图如下:
    课程表

  • 下面是代码区:

  1. <!DOCTYPE html>
  2. <html lang="en">
  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. <style>
  9. * {
  10. text-align: center;
  11. }
  12. </style>
  13. </head>
  14. <body>
  15. <!-- cellpadding 属性规定的是单元边沿与单元内容之间的空间
  16. cellspacing 属性规定的是单元之间的空间 -->
  17. <table border="1" style="width: 90%; " cellspacing="0" cellspadding="5">
  18. <!-- 定义表格标题 -->
  19. <caption style="font-size: 2em;">课程表</caption>
  20. <!-- 表格的页眉 -->
  21. <thead style="background-color: aquamarine;">
  22. <!-- 定义表头 -->
  23. <th>时间</th>
  24. <th>星期一</th>
  25. <th>星期二</th>
  26. <th>星期三</th>
  27. <th>星期四</th>
  28. <th>星期五</th>
  29. </thead>
  30. <!-- 表格主体 -->
  31. <tbody>
  32. <!-- 课程内容 -->
  33. <tr>
  34. <td rowspan="4" style="background-color: cornflowerblue;">上午</td>
  35. <td>语文</td>
  36. <td>语文</td>
  37. <td>语文</td>
  38. <td>语文</td>
  39. <td>语文</td>
  40. </tr>
  41. <tr>
  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. </tr>
  55. <tr>
  56. <td>音乐</td>
  57. <td>音乐</td>
  58. <td>音乐</td>
  59. <td>音乐</td>
  60. <td>音乐</td>
  61. </tr>
  62. <tr>
  63. <td colspan="6" style="background-color: darkslategray;">午休</td>
  64. </tr>
  65. <tr>
  66. <td rowspan="2" style="background-color: cornflowerblue;">下午</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. </tr>
  80. <tr style="background-color: forestgreen;">
  81. <td>备注:</td>
  82. <td colspan="5">每天下午16:00-17:00写完作业再回家</td>
  83. </tr>
  84. </tbody>
  85. </table>
  86. </body>
  87. </html>
  • 用户注册效果图如下:
    注册
  • 代码如下:
  1. <!DOCTYPE html>
  2. <html lang="en">
  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 action="" style="display: grid; gap: 0.5em" method="POST">
  11. <fieldset>
  12. <legend>必填选项</legend>
  13. <div>
  14. <label for="username">用户名:</label>
  15. <!-- autofocus是光标自动定位到编辑框,required是必填选项 placeholder是提示内容文本-->
  16. <input type="text" name="username" id="username" autofocus required placeholder="这里填账号">
  17. </div>
  18. <div>
  19. <label for="password">密&nbsp;&nbsp;&nbsp;码:</label>
  20. <input type="password" name="password" id="password" required placeholder="这里填密码">
  21. </div>
  22. <div>
  23. <label for="email">邮&nbsp;&nbsp;&nbsp;箱:</label>
  24. <input type="email" name="email" id="email" required placeholder="这里填邮箱">
  25. </div>
  26. </fieldset>
  27. <div>
  28. <label for="secret">性别:</label>
  29. <input type="radio" name="gender" id="male" value="male">
  30. <label for="gender"></label>
  31. <input type="radio" name="gender" id="female" value="female">
  32. <label for="gender"></label>
  33. <input type="radio" name="gender" id="secret" value="secret" checked>
  34. <label for="gender">保密</label>
  35. </div>
  36. <div>
  37. <label for="">兴趣爱好</label>
  38. <input type="checkbox" name="aihao[]" id="lvyou" value="lvyou"><label for="lvyou">旅游</label>
  39. <input type="checkbox" name="aihao[]" id="diaoyu" value="diaoyu"><label for="diaoyu">钓鱼</label>
  40. <input type="checkbox" name="aihao[]" id="huwai" value="huwai"><label for="huwai">户外</label>
  41. <input type="checkbox" name="aihao[]" id="youyong" value="youyong"><label for="youyong">游泳</label>
  42. </div>
  43. <div>
  44. <label for="">人生目标</label>
  45. <select name="" id="">
  46. <option value="1">PHP终极目标光头佬</option>
  47. <option value="2" selected>PHP从入门到放弃</option>
  48. <option value="3">PHP从入门到精通</option>
  49. </select>
  50. </div>
  51. <div>
  52. <button type="submit">提交</button>
  53. </div>
  54. </form>
  55. </body>
  56. </html>

css预习部分

  • CSS是Cascading Style Sheets的缩写,即层叠样式表,也被称作“串样式表”、“级联样式表”等。CSS是一种用来为结构化文档(如HTML文档或XML应用)添加样式(字体、间距和颜色等)的计算机语言!
    参考资料~MDN
    参考资料~菜鸟
    参考资料~w3school
声明:本文内容转载自脚本之家,由网友自发贡献,版权归原作者所有,如您发现涉嫌抄袭侵权,请联系admin@php.cn 核实处理。
全部评论
文明上网理性发言,请遵守新闻评论服务协议