We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CSS 选择器整理
.parent > .child
p + h2
li.active ~ li
多个基础选择器可以连起来(不使用空格或者其他组合器)组成一个复合(compound)选择器(例如:h1.page-header)。 复合选择器选中的元素将匹配其全部基础选择器。 例如,.dropdown.is-active 能够选中<div class="dropdown is-active">,但是无法选中<div class="dropdown">
h1.page-header
.dropdown.is-active
<div class="dropdown is-active">
<div class="dropdown">
比如:
:first-child :last-child :disabled——匹配已禁用的元素,包括 input、select 以及 button 元素
::first-line ::first-letter ::before ::after
input[disabled]
input[type="radio"]
a[href^="https"]
a[href$= ".pdf"]
[class*="sprite-"]
a[rel="author"]
CSS in Depth
The text was updated successfully, but these errors were encountered:
No branches or pull requests
CSS 选择器整理
基础选择器
组合器
.parent > .child
。p + h2
。li.active ~ li
。复合选择器
多个基础选择器可以连起来(不使用空格或者其他组合器)组成一个复合(compound)选择器(例如:
h1.page-header
)。 复合选择器选中的元素将匹配其全部基础选择器。 例如,.dropdown.is-active
能够选中<div class="dropdown is-active">
,但是无法选中<div class="dropdown">
伪类选择器
比如:
伪元素选择器
比如:
属性选择器
input[disabled]
。input[type="radio"]
a[href^="https"]
。a[href$= ".pdf"]
。[class*="sprite-"]
。a[rel="author"]
。The text was updated successfully, but these errors were encountered: