Why is a pseudo-class so called?

前端 未结 5 576
甜味超标
甜味超标 2020-12-11 04:45
a:hover

Why is it called a \"pseudo-class\"?

Are there any similarities with the concept of \"class\"?

5条回答
  •  野趣味
    野趣味 (楼主)
    2020-12-11 05:26

    In CSS terms, a class is a selector that starts with a full stop, e.g.

    .foo { ... }
    

    It would be used in the form

    This use of "class" is more in the sense "a set or category of things having a common characteristic and differentiated from others by kind or quality", rather than borrowing from OO terminology.

    A pseudo class is "not quite a real one" as the user agent defines when and/or how much content qualifies (like :hover, :active, etc).

提交回复
热议问题