博客列表 >210319 HTML 标签

210319 HTML 标签

xyphpblog
xyphpblog原创
2021年03月24日 16:36:18502浏览

1. 课程表练习

  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>Timetable</title>
  8. </head>
  9. <body>
  10. <div>
  11. <table border="1" cellspacing="0" cellpadding="3" align="center">
  12. <caption>
  13. <h3>S1 Timetable</h3>
  14. </caption>
  15. <thead>
  16. <tr bgcolor="lightblue">
  17. <th>Time</th>
  18. <th>Monday</th>
  19. <th>Tuesday</th>
  20. <th>Wednesday</th>
  21. <th>Thursday</th>
  22. <th>Friday</th>
  23. </tr>
  24. </thead>
  25. <tbody align="center">
  26. <tr>
  27. <td rowspan="3">Morning</td>
  28. <td>Chinese</td>
  29. <td>Maths</td>
  30. <td>English</td>
  31. <td>Physics</td>
  32. <td>PE</td>
  33. </tr>
  34. <tr>
  35. <!-- <td></td> -->
  36. <td>Maths</td>
  37. <td>English</td>
  38. <td>Geography</td>
  39. <td>Chemistry</td>
  40. <td>Computer</td>
  41. </tr>
  42. <tr>
  43. <!-- <td></td> -->
  44. <td>Maths</td>
  45. <td>English</td>
  46. <td>Geography</td>
  47. <td>Chemistry</td>
  48. <td>Computer</td>
  49. </tr>
  50. <tr bgcolor="#ffff0f">
  51. <td colspan="6">Break</td>
  52. </tr>
  53. <tr>
  54. <td rowspan="3">Afternoon</td>
  55. <td>Maths</td>
  56. <td>English</td>
  57. <td>Geography</td>
  58. <td>Chemistry</td>
  59. <td>Computer</td>
  60. </tr>
  61. <tr>
  62. <!-- <td></td> -->
  63. <td>English</td>
  64. <td>Chinese</td>
  65. <td>Maths</td>
  66. <td>English</td>
  67. <td>Physics</td>
  68. </tr>
  69. <tr>
  70. <!-- <td></td> -->
  71. <td>Maths</td>
  72. <td>Chinese</td>
  73. <td>Computer</td>
  74. <td>English</td>
  75. <td>Physics</td>
  76. </tr>
  77. </tbody>
  78. <tfoot>
  79. <tr bgcolor="lightgrey">
  80. <td>Note</td>
  81. <td colspan="5">hehe</td>
  82. </tr>
  83. </tfoot>
  84. </table>
  85. </div>
  86. </body>
  87. </html>

Timetable


2. Form 练习

  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>Document</title>
  8. </head>
  9. <body>
  10. <div>
  11. <form action="www.baidu.com" method="POST" target="_blank"
  12. style="display: grid; gap: 0.5em; min-width: 200px; max-width: 300px; position: absolute; top: 50%; left: 50%; transform: translate(-50%,-65%);">
  13. <!-- title -->
  14. <h3>Registration</h3>
  15. <fieldset>
  16. <!-- username -->
  17. <div>
  18. <label for="uname" style="display: block;">Username*</label>
  19. <input type="text" name="uname" id="uname" required placeholder="10 characters" autofocus>
  20. </div>
  21. <!-- password -->
  22. <div>
  23. <label for="upwd" style="display: block;">Password*</label>
  24. <input type="password" name="upwd" id="upwd" required placeholder="password">
  25. </div>
  26. <!-- email -->
  27. <div>
  28. <label for="umail" style="display: block;">Email*</label>
  29. <input type="email" name="umail" id="umail" required placeholder="example: abc@163.com">
  30. </div>
  31. </fieldset>
  32. <!-- gender -->
  33. <div>
  34. <label for="secret">Gender</label>
  35. <input type="radio" name="gender" id="male" value="male"><label for="male">Male</label>
  36. <input type="radio" name="gender" id="female" value="female"><label for="female">Female</label>
  37. <input type="radio" name="gender" id="secret" value="secret" checked><label for="secret">Prefer not
  38. to
  39. say</label>
  40. </div>
  41. <!-- interest -->
  42. <div>
  43. <label for="">Interests</label>
  44. <input type="checkbox" name="interest[]" id="eat"><label for="eat">Eat</label>
  45. <input type="checkbox" name="interest[]" id="sleep" checked><label for="sleep">Sleep</label>
  46. <input type="checkbox" name="interest[]" id="play"><label for="play">Play</label>
  47. </div>
  48. <!-- select -->
  49. <div>
  50. <label for="">Level</label>
  51. <select name="level" id="">
  52. <option value="1">A</option>
  53. <option value="2">B</option>
  54. <option value="3">C</option>
  55. <option value="4">D</option>
  56. <option value="5">E</option>
  57. </select>
  58. </div>
  59. <!-- datalist -->
  60. <div>
  61. <label for="">Keyword:</label>
  62. <input type="search" name="search" id="" list="mykey">
  63. <datalist id="mykey">
  64. <option value="html">HTML</option>
  65. <option value="css">CSS</option>
  66. <option value="java">JAVA</option>
  67. </datalist>
  68. </div>
  69. <!-- submit button -->
  70. <div>
  71. <button>Submit</button>
  72. </div>
  73. </form>
  74. </div>
  75. </body>
  76. </html>

form


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