👋 Hello, I am Seung-ho Ham

🧑🏻‍💻 A Developers who create code that changes the world

카테고리 없음

[DEV] CSS선택자3

Potato_H 2021. 5. 24. 19:15
반응형

가상 요소 선택자(Pseudo-Elements)

before : 선택자 x요소 내부 앞에 내용(content)을 삽입
.x::before{
content: "앞";
}

after : 선택자 x 요소의 내부 뒤에 내용(content)을 삽입
.x::after {
content: "뒤";
}

속성 선택자(Attribute)

attr : 속성 x를 포함한 요소 선택
[x]{
color: red;
}

attr=value : 속성 x를 포함하고 값이 y인 요소 선택
[x="y"]{
color:red;
}