Blogger Information
Blog 19
fans 0
comment 1
visits 7434
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
1020作业
移动用户-4050479
Original
353 people have browsed it

权重

  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. <!-- !权重实体标记 class id tag-->
  9. <!-- !权重顺序 class id tag=>(标签) -->
  10. <!-- !计数方式 选择器的数量-->
  11. <!-- !权重优先级 id > class > tag -->
  12. <!-- !尽量不用 id id 权重过高 -->
  13. <style>
  14. h1 { /* ( 0 ,0 , 1)
  15. ( id , class , tag )*/
  16. /* ! 权重表示方法 */
  17. color: brown;
  18. }
  19. h2 .table { /* (0 , 1 , 1 ) */
  20. color: aqua;
  21. }
  22. h1 #ac .title { /* ( 1 , 1 , 1) */
  23. color: #000;
  24. }
  25. h1 #mvc p #ac .title { /* ( 2 , 1 , 2) */
  26. color: #000;
  27. }
  28. /* 提权 */
  29. li.cv {
  30. background-color: rgb(200, 118, 18);
  31. }
  32. li {
  33. background-color: rgb(30, 169, 122);
  34. }
  35. /* 提权 */
  36. div p {
  37. color: blueviolet;
  38. }
  39. p {
  40. color: chartreuse;
  41. }
  42. /* ! */
  43. </style>
  44. </head>
  45. <body>
  46. <div>
  47. <p>cvvvvvvvv</p>
  48. </div>
  49. <ul class="css">
  50. <li class="cv">abc2</li>
  51. <li class="cv">abc3</li>
  52. <li class="cv">abc4</li>
  53. <li class="cv">abc5</li>
  54. <li class="cv">abc6</li>
  55. <li class="cv">abc7</li>
  56. <li class="cv">abc8</li>
  57. <li class="cv">abc9</li>
  58. <li class="cv">abc10</li>
  59. </ul>
  60. </body>
  61. </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>Document</title>
  8. <style>
  9. /* 结构伪类 匹配子元素 要设置查询起点 */
  10. /* 选择全部 */
  11. .css > li:nth-of-type(n) {
  12. background-color:gainsboro ;
  13. }
  14. /* 选择第一个 */
  15. .css > li:first-of-type {
  16. background-color: rgb(255, 123, 0);
  17. }
  18. /* */
  19. .css > li:last-of-type {
  20. background-color: rgb(255, 132, 0);
  21. }
  22. /* 状态伪类 */
  23. /* :nth-of-type( an + b ) 参数是 an + b */
  24. /*
  25. * a : 系数 取值范围是 1-3
  26. * n :参数 取值范围 1-3
  27. * b :偏移量 从 0 开始
  28. 规则 :从一开始
  29. */
  30. /* 选择一个数据 需要 a = 0 */
  31. .css > li:nth-of-type( 0n + 3 ){
  32. background-color: aqua;
  33. }
  34. .css > li:nth-of-type( 0n + 3 ){
  35. background-color: aqua;
  36. }
  37. /* 选择一组数据 */
  38. /*
  39. 全选
  40. .css > li:nth-of-type(n){
  41. background-color: blueviolet;
  42. } */
  43. </style>
  44. </head>
  45. <body>
  46. <!-- 结构伪类 -->
  47. <ul class="css">
  48. <li class="vb">1</li>
  49. <li class="vb">2</li>
  50. <li class="vb">3</li>
  51. <li class="vb">4</li>
  52. <li class="vb">5</li>
  53. <li class="mv">6</li>
  54. <li class="mv">7</li>
  55. <li class="mv">8</li>
  56. <li class="mv">9</li>
  57. <li class="bn">10</li>
  58. <li class="bn">11</li>
  59. <li class="bn">12</li>
  60. <li class="bn">13</li>
  61. <li class="bn">14</li>
  62. </ul>
  63. </body>
  64. </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