CSS伪类与伪选择器 [英] CSS pseudo-class vs. pseudo-selector

查看:84
本文介绍了CSS伪类与伪选择器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是一个古怪的问题,但也许值得一问.从机械上来说,CSS中的伪类和伪选择器之间是否存在区别?我们在此处互换使用该术语,但似乎有两个原因是有原因的.区分两者有什么用?

This is a bit of a pedantic question, but perhaps worth asking. Is there, mechanically, a difference between a pseudo-class and a pseudo-selector in CSS? We use the term interchangeably around here, but it seems that there's a reason for the two terms. Is there any use to differentiating the two?

推荐答案

A pseudo-class是指定的东西,而pseudo-selector是一个伪造的单词.

A pseudo-class is a specified thing, while pseudo-selector is a made up word.

(与此同时,当满足某些条件时(例如,鼠标指向它,或者它是它的父对象的第一个孩子),伪类与一个元素匹配),而伪元素是可以匹配的,但不是真实的元素或整个元素,例如元素之前的东西"或元素中的第一行文字".)

(Meanwhile, a pseudo-class matches an element when certain conditions are met (e.g. the mouse is pointing at it, or it is the first child of its parent), while a pseudo-element is something that can be matched but isn't a real or whole element, such as "Thing before an element" or "First line of text in an element".)

这篇关于CSS伪类与伪选择器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆