What does the double colon (::
) mean in CSS?
For example:
input[type=text]::-ms-clear { display: none; }
ベストアンサー1
It means pseudo element selector. It means the element to the right doesn't exist in the normal DOM, but can be selected.
A pseudo-element is made of two colons (::) followed by the name of the pseudo-element.
It was originally only a single colon, but was changed to differentiate it from pseudo classes (like :hover
, :first-child
, :not
etc). It's best to use :
for before
and after
pseudo elements since the single colon has better browser support, namely in earlier IE versions.