This is default featured slide 1 title

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.

This is default featured slide 2 title

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.

This is default featured slide 3 title

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.

This is default featured slide 4 title

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.

This is default featured slide 5 title

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.

*/

CSS 선택자

CSS에서 선택자(Selector)란 ?

  • HTML요소를 선택하여 적용하여 스타일을 적용하는데 사용할 요소


선택자의 종류

기본 선택자 :

  • 전체 선택자 ( * ) : 모든 HTML 요소
  • 태그 선택자 ( p, div ) : 특정 태그 이름을 가진 요소
  • ID 선택자 ( ) : id 속성 값이 특정 문자열과 일치하는 요소 (ex. #name)
  • 클래스 선택자 ( ) : class 속성 값에 특정 문자열이 포함된 요소(ex. .name)

후손(하위) 선택자 (  ) : 특정 요소 안에 있는 다른 요소(ex. div p) 

자식 선택자 ( > ) : 특정 요소의 직접적인 자식 요소(ex. div > p)

형제 선택자 ( + ) : 특정 요소 바로 다음에 오는 형제 요소(ex. h1 + p)

인접 형제 선택자 ( ~ ) : 특정 요소 뒤에 오는 모든 형제 요소(ex. h1 ~ p)

그룹 선택자 ( , ) : 모든 특정 요소(ex. h1, p) 

속성 선택자 ( [ ] ) : 특정 속성을 가진 요소(ex. [type="button"])

가상 클래스 선택자 : 특정 상태에 있는 요소(ex. :hover)

가상 요소 선택자 : 특정 요소 앞에 가상의 요소(ex. :before)