AhuntSun-blog

在html中有以下结构:
--- -----

<div class="row100">
    <div class="col">
        <div class="inputBox textarea">
            <div>123</div>
        </div>
    </div>
</div>

在CSS文件中修改其样式:

  • 选择器1:
.row100 .inputBox .textarea div{}
  • 选择器2:
.row100 .inputBox div{}
  • 选择器3:
.row100 div{}

选择器2和3是正确的,两者区别在于权重值大小不同。而选择器1是错误的。

因为CSS选择器中,不能出现一个以上指向同一个标签的选择器。


  • 在选择器1中 .inputBox .textarea两个选择器指向同一个标签:div,所以这个选择器是错误的。

分类:

技术点:

相关文章:

  • 2022-12-23
  • 2022-01-04
  • 2021-12-06
  • 2021-06-09
  • 2022-12-23
  • 2022-02-08
  • 2022-01-20
猜你喜欢
  • 2021-10-02
  • 2022-01-25
  • 2021-08-15
  • 2021-04-22
  • 2021-08-27
  • 2022-03-05
  • 2021-12-15
相关资源
相似解决方案