I have seen CSS like Custom Scrollbars in WebKit
body::-webkit-scrollbar {
width: 10px;
height: 13px;
background-color: white;
color: #EBEBEB;
border:none;
}
This specifies CSS for WebKit browsers. But what does this operator (::) mean in CSS?
Where can I find other such operators in CSS?
It indicates that what follows is a “pseudo-element”. From the CSS Selectors level 3 spec:
And a pseudo-element creates an “abstraction about the document tree”:
For example, the
::webkit-scrollbarpseudo-element provides a mechanism to refer to the webkit scrollbar, which would be otherwise inaccessible. Another example: the::first-letterpseudo-element provides a way to refer to the first letter of an element (if it is not preceded by any other content).