Blogger Information
Blog 26
fans 0
comment 1
visits 10546
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
1024作业
P粉751989631
Original
680 people have browsed it

1. em,rem的特点是什么, 应用场景是什么?为什么推荐使用rem?

  1. emrem都是属于相对单位
  2. em: 继承字号,受自身和祖先影响
  3. rem: 根字号, 字号常量不变,可以自定义,默认是16px,除非人为更新,否则不变。
  4. em的设置方式:推荐PC
  5. rem的设置方式:推荐移动端
  6. 目前主流的移动端解决方案:REM+VW(根字号+视口单位)

2.使用rem+vw做表格

  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. <style>
  9. table td,
  10. table th {
  11. border: 1px solid #000;
  12. }
  13. table {
  14. border-collapse: collapse;
  15. }
  16. table {
  17. width: 90%;
  18. margin: center;
  19. text-align: center;
  20. }
  21. table caption {
  22. font-size: 1.2em;
  23. margin-bottom: 0.6em;
  24. }
  25. table thead {
  26. background-color: lightgreen;
  27. }
  28. table tbody:not(tbody:nth-of-type(2)) tr:first-of-type td:first-of-type {
  29. background-color: lightcyan;
  30. }
  31. </style>
  32. </head>
  33. <body>
  34. <table>
  35. <style>
  36. line-height:30px
  37. width:40VW
  38. text-align::content
  39. font-size:0.16rem
  40. border-radius:0.1rem
  41. border-collapse:collapse
  42. </style>
  43. </table>
  44. <table>
  45. <caption>
  46. 前洲中心小学课程表
  47. </caption>
  48. <thead>
  49. <tr>
  50. <th>时间</th>
  51. <th>周一</th>
  52. <th>周二</th>
  53. <th>周三</th>
  54. <th>周四</th>
  55. <th>周五</th>
  56. </tr>
  57. </thead>
  58. <tbody>
  59. <tr>
  60. <td rowspan="4" class="period">上午</td>
  61. <td>数学</td>
  62. <td>数学</td>
  63. <td>数学</td>
  64. <td>数学</td>
  65. <td>数学</td>
  66. </tr>
  67. <tr>
  68. <td>数学</td>
  69. <td>数学</td>
  70. <td>数学</td>
  71. <td>数学</td>
  72. <td>数学</td>
  73. </tr>
  74. <tr>
  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. </tr>
  88. </tbody>
  89. <tbody>
  90. <tr>
  91. <td colspan="6">中午休息</td>
  92. </tr>
  93. </tbody>
  94. <tbody>
  95. <tr>
  96. <td rowspan="3" class="period">下午</td>
  97. <td>音乐</td>
  98. <td>音乐</td>
  99. <td>体育</td>
  100. <td>体育</td>
  101. <td>体育</td>
  102. </tr>
  103. <tr>
  104. <td>美术</td>
  105. <td>美术</td>
  106. <td>美术</td>
  107. <td>美术</td>
  108. <td>美术</td>
  109. </tr>
  110. <tr>
  111. <td>科学</td>
  112. <td>科学</td>
  113. <td>科学</td>
  114. <td>科学</td>
  115. <td>科学</td>
  116. </tr>
  117. </tbody>
  118. <tfoot>
  119. <tr>
  120. <td>备注:</td>
  121. <td colspan="5">每天下午15:30-17:30在校写作业</td>
  122. </tr>
  123. </tfoot>
  124. </table>
  125. </body>
  126. </html>

运行结果

Correcting teacher:PHPzPHPz

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