CSS Reference
HTML
JavaScript
Development
highlight_alt
Selector
work_outline
Properties
settings
Functions
rule
Rules
category
Types
straighten
Units
article
Documents
manage_search
Indexing
search
검색
Selectors
Selectors
Attribute selectors
Attribute presence and value selectors
Substring matching attribute selectors
Case-sensitivity
Class Selector
ID Selector
Combinators
Adjacent sibling combinator
Child combinator
Descendant combinator
Element Display State Pseudo-classes
:fullscreen
:modal
:picture-in-picture
Elemental selectors
:defined
Namespace in Elemental Selectors
Tag Type Selector
Universal Selector
Input Pseudo-classes
:autofill
:checked
:default
:disabled
:enabled
:in-range
:indeterminate
:invalid
:optional
:out-of-range
:placeholder-shown
:read-only
:read-write
:required
:valid
Linguistic Pseudo-classes
:lang()
Location Pseudo-classes
:any-link
:link
:scope
:target
:visited
Logical Combinations
:has()
:is()
:not()
:where()
Selector Lists
Page Selectors
:first
:left
:right
Pseudo-elements
::after
::backdrop
::before
::file-selector-button
::first-letter
::first-line
::marker
::part()
::placeholder
::selection
Resource State Pseudo-classes
:buffering
:muted
:paused
:playing
:seeking
:stalled
:volume-locked
Scoping
:host
:host()
:host-context()
Time-dimensional Pseudo-classes
:future
:past
Tree-Structural Pseudo-classes
:empty
:first-child
:first-of-type
:last-child
:last-of-type
:nth-child()
:nth-last-child()
:nth-last-of-type()
:nth-of-type()
:only-child
:only-of-type
:root
User Action Pseudo-classes
:active
:focus
:focus-visible
:focus-within
:hover
account_tree
bug_report
Location Pseudo-classes
웹 문서의 위치를 기반으로 가상 클래스로 선택하는 방식이다.
관련 선택자 유형
:any-link
하이퍼링크의 소스 앵커 역할을 하는 요소를 사용한다. 예를 들어서
href
속성이 있는
a
또는
area
요소는 하이퍼링크이므로
:any-link
와 일치한다.
:link
href
속성을 가지고 있으면서 사용자가 방문한 적이 없는 경우에 선택자로 사용이 된다.
:scope
범위 지정 루트를 나타내며 실제 요소이거나 가상 요소(예: DocumentFragment)일 수 있다. 범위 지정 루트가 없으면
:scope
는 문서의 루트를 나타낸다.
:target
URL 해쉬와 일치하는
id
를 가진 유일한 요소를 선택자로 사용한다.
:visited
href
속성을 가지고 있으면서 방문한 적이 있는 경우에 선택자로 사용이 된다.
W3C Modules
Selectors Level 4 - Location Pseudo-classes
W3C Working Draft, 11 November 2022