css伪类选择器_Web开发人员阅读列表:CSS伪类选择器

css伪类选择器

In contrast to standard CSS selectors, pseudo selectors allow you to alter the appearance of a state or fragment of an element. They are divided into pseudo class selectors and pseudo element selectors.

标准CSS选择器相比选择器允许您更改状态或元素片段的外观 。 它们分为伪选择器和元素选择器

  1. Pseudo-class selectors describe the state of an element, such as :hover or :empty. On a style sheet, they are preceded by a single colon.

    选择器描述元素的状态 ,例如:hover:empty 。 在样式表上,它们前面是单个冒号。

  2. As their name suggests pseudo-element selectors control the presentation of a portion of content, such as the first line or letter of a paragraph. Formally, they are preceded by a double colon (::), although a single colon will work in most cases.

    顾名思义, 元素选择器控制部分内容的表示 ,例如段落的第一行或字母。 正式地,它们前面有一个双冒号( :: ,尽管在大多数情况下一个冒号也可以。

Pseudo selectors are distinguished by the fact that they must be written in an embedded, linked or scoped style sheet: they cannot be written inline.

伪选择器的特征在于它们必须嵌入式,链接的或作用域的样式表编写:它们不能内联编写。

This list is not yet exhaustive: pseudo-class selectors such as ::hover are used extensively in tutorials on this site, but do not yet have their own individual articles. As soon as that changes, they will be added here.

该列表尚未穷尽:该站点的教程中广泛使用了伪类选择器(如::hover ,但还没有自己的文章。 更改后,将在此处添加它们。

翻译自: https://thenewcode.com/176/Web-Developer-Reading-List-CSS-Pseudo-Class-Selectors

css伪类选择器

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值