CSS 선택자
CSS에서 선택기는 스타일을 지정할 요소를 선택하는 데 사용되는 패턴입니다.
CSS 선택기 테스터 를 사용 하여 다양한 선택기를 시연하십시오.
Show All
Search
Selector
Example
Example description
.class1.class2
.name1.name2
Open
Selects all elements with both name1 and name2 set within its class attribute
.class1 .class2
.name1 .name2
Open
Selects all elements with name2 that is a descendant of an element with name1
div + p
Open
Selects the first <p> element that is placed immediately after <div> elements
[title~=flower]
Open
Selects all elements with a title attribute containing the word "flower"
a[href^="https"]
Open
Selects every <a> element whose href attribute value begins with "https"
a[href$=".pdf"]
Open
Selects every <a> element whose href attribute value ends with ".pdf"
a[href*="w3schools"]
Open
Selects every <a> element whose href attribute value contains the substring "w3schools"
p:first-of-type
Open
Selects every <p> element that is the first <p> element of its parent
p:lang(it)
Open
Selects every <p> element with a lang attribute equal to "it" (Italian)
p:nth-last-child(2)
Open
Selects every <p> element that is the second child of its parent, counting from the last child
p:nth-last-of-type(2)
Open
Selects every <p> element that is the second <p> element of its parent, counting from the last child
p:nth-of-type(2)
Open
Selects every <p> element that is the second <p> element of its parent
Load more