What does the '::' selector mean in CSS

后端 未结 1 1731
渐次进展
渐次进展 2021-01-24 04:24

I came across a blog-post, where :: was used in their CSS code.

Here is part of their code:

::-webkit-scrollbar {
  width: 10px;
}


        
相关标签:
1条回答
  • 2021-01-24 04:51

    :: signifies a pseudo-element, as opposed to a pseudo-class :. Pre-CSS3 they both used : and support is a little scrappy for the :: syntax still.

    A pseudo-class filters existing elements.

    a:link means all <a>s that are :link.

    A pseudo-element is a new fake element. div::after create a "fake" element with <div> but after its content.

    References

    • What is the difference between a pseudo-class and a pseudo-element in CSS?
    • Pseudo-element tag info
    0 讨论(0)
提交回复
热议问题