Blogger Information
Blog 42
fans 0
comment 0
visits 15656
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
0707伪类选择器/盒模型
小言
Original
313 people have browsed it
  1. <ul class="list">
  2. <li class="first">item1</li>
  3. <li>item2</li>
  4. <li>item3</li>
  5. <li>item4</li>
  6. <li>item5</li>
  7. <li>item6</li>
  8. <li>item7</li>
  9. <li>item8</li>
  10. </ul>
  1. css内容
  2. /**全部变成统一背影色*/
  3. .list >li:nth-of-type(n){
  4. background-color: brown;
  5. }
  6. /**奇数变成某一个颜色*/
  7. .list >li:nth-of-type(2n + 1){
  8. background-color: aqua;
  9. }
  10. /**偶数变成某一个颜色*/
  11. .list >li:nth-of-type(2n + 2){
  12. background-color: burlywood;
  13. }
  14. /**第三个 变成 黑色,然后到第五个变成 黑色*/
  15. .list >li:nth-of-type(5n + 3){
  16. background-color: black;
  17. }

  1. <div class="box"></div>
  2. <style>
  3. .box{
  4. background-color: aqua;
  5. background-clip: content-box;
  6. height: 150px;
  7. width: 150px;
  8. box-sizing: border-box;
  9. padding: 10px;
  10. margin: 30px;
  11. border: 1px solid red;
  12. }
  13. </style>

盒子模型学习使用margin/padding

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