Blogger Information
Blog 20
fans 1
comment 0
visits 17620
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
1209 作业
xosing的博客
Original
578 people have browsed it

1209 作业

列表元素有:

1.无序列表 ul+li

  1. <ul>
  2. <li>内容</li>
  3. </ul>

2.有序列表 ol+li

  1. <ol>
  2. <li>内容</li>
  3. </ol>

3.自定义列表 dl+dt+dd

  1. <dl>
  2. <dt>名称</dt>
  3. <dd>内容</dd>
  4. </dl>

表格的制作:

  1. <!--
  2. table 组成表格的结构
  3. caption 表格标题
  4. thead 表头 每个表格只允许出现一次
  5. tbody 主体
  6. tr 每个表格的行数
  7. td 每个表格的列数 ~ 所有表格内容都在里面填写
  8. th 是td的扩展版,文字居中且加粗
  9. colspan 行合并
  10. rowspan 列合并
  11. -->
  12. <table border="1">
  13. <caption>php中文网14期学员课程表</caption>
  14. <thead>
  15. <tr>
  16. <th colspan="2"></th>
  17. <th>星期一</th>
  18. <th>星期二</th>
  19. <th>星期三</th>
  20. <th>星期四</th>
  21. <th>星期五</th>
  22. </tr>
  23. </thead>
  24. <tbody>
  25. <tr>
  26. <td rowspan="4">上午</td>
  27. <td>1</td>
  28. <td>HTML</td>
  29. <td>CSS</td>
  30. <td>PHP</td>
  31. <td>JS</td>
  32. <td>MYSQL</td>
  33. </tr>
  34. <tr>
  35. <td>2</td>
  36. <td>PHP</td>
  37. <td>JS</td>
  38. <td>CSS</td>
  39. <td>CSS</td>
  40. <td>JS</td>
  41. </tr>
  42. <tr>
  43. <td>3</td>
  44. <td>CSS</td>
  45. <td>PHP</td>
  46. <td>MYSQL</td>
  47. <td>HTML</td>
  48. <td>JS</td>
  49. </tr>
  50. <tr>
  51. <td>4</td>
  52. <td>HTML</td>
  53. <td>CSS</td>
  54. <td>JS</td>
  55. <td>PHP</td>
  56. <td>CSS</td>
  57. </tr>
  58. <tr>
  59. <th colspan="7">中午休息</th>
  60. </tr>
  61. <tr>
  62. <td rowspan="3">下午</td>
  63. <td>5</td>
  64. <td>JS</td>
  65. <td>PHP</td>
  66. <td>MYSQL</td>
  67. <td>CSS</td>
  68. <td>PHP</td>
  69. </tr>
  70. <tr>
  71. <td>6</td>
  72. <td>实战</td>
  73. <td>实战</td>
  74. <td>实战</td>
  75. <td>实战</td>
  76. <td>实战</td>
  77. </tr>
  78. <tr>
  79. <td>7</td>
  80. <td colspan="4">课外活动</td>
  81. <td>全体大扫除</td>
  82. </tr>
  83. </tbody>
  84. </table>

表格示例如下图

表单的控件与实例:

  1. action 接收表单内容的程序
  2. method 提交内容的方式,有两种
  3. value 数据内容
  4. name 数据的变量名
  5. 1. GET 方法提交的内容显示在URL中,即也是默认方式
  6. 2. POST 方法提交到请求体中,如数据库,JS
  7. type:控件类型,text:通用类型,email:邮箱,password:密码/非明文
  8. required 提交的数据不能为空
  9. placeholder 提示文本
  10. radio 单选框
  11. checkbox 复选框
  12. checked 默认选项
  13. select 下拉框 option 赋值 默认值为selected
  14. hidden 隐藏域

例子如下

  1. 通用型:
  2. <label for="username">姓名:</label>
  3. <form action="demo.php" method="POST">
  4. <input type="text" id="username" required placeholder="用户名">
  5. </form>

  1. 邮箱类型:
  2. <label for="email">邮箱:</label>
  3. <form action="demo.php" method="POST">
  4. <input type="email" id="email" required placeholder="name@url.com">
  5. </form>

  1. 密码类型:
  2. <label for="password">密码:</label>
  3. <form action="demo.php" method="POST">
  4. <input type="password" id="password" required placeholder="至少8位数且有字母">
  5. </form>

  1. 单选框:
  2. <label for="boy">性别:</label>
  3. <div>
  4. <!-- 单选按钮共用名称的name属性值,否则无法实现唯一性 -->
  5. <input type="radio" name="sex" value="boy" id="boy" /><label for="boy" checked>男</label>
  6. <input type="radio" name="sex" value="girl" id="girl" /><label for="girl">女</label>
  7. </div>

  1. 复选框:
  2. <label for="#">兴趣:</label>
  3. <div>
  4. <!-- 复选框的name属性值应该写与数组的格式名称[],这样才确保服务器可以接收到一组值 -->
  5. <input type="checkbox" name="hobby[]" value="game" id="game" checked /> <label for="game">游戏</label>
  6. <input type="checkbox" name="hobby[]" value="travel" id="travel" /> <label for="travel">旅游</label>
  7. <input type="checkbox" name="hobby[]" value="program" id="program" checked /> <label for="program">编程</label>
  8. </div>

示例如下图

Correcting teacher:天蓬老师天蓬老师

Correction status:qualified

Teacher's comments:
Statement of this Website
The copyright of this blog article belongs to the blogger. Please specify the address when reprinting! If there is any infringement or violation of the law, please contact admin@php.cn Report processing!
All comments Speak rationally on civilized internet, please comply with News Comment Service Agreement
0 comments
Author's latest blog post