美文网首页
nth-of-type(n)和:nth-child(n)的关系

nth-of-type(n)和:nth-child(n)的关系

作者: newway_001 | 来源:发表于2019-06-03 19:14 被阅读0次

    鉴于昨天和今天我已经百度了3次这两个选择器了。
    我决定将他做个笔记:

    div:nth-of-type(n)代表他是第n个类型为div的子元素

    div:nth-child(n) 代表第n个子元素,且元素类型为div,两者为并集关系

    相关文章

      网友评论

          本文标题:nth-of-type(n)和:nth-child(n)的关系

          本文链接:https://www.haomeiwen.com/subject/rdshxctx.html