관리 메뉴

moozi

10/7 css selector 본문

TIS_2020/빅데이터2020_1기

10/7 css selector

moozi 2020. 10. 7. 15:37

CSS 셀렉터

1. 태그 selector
p { color:red; }
h1 { color:blue; }

2. id selector
#video { width:500px; }
=> id는 현재 페이지에서 unique하게 사용

3. class selector
.title { color:red; }
=> 중복해서 사용 가능

4. grouping selector
h1, p, span { color:red; }
=> 여러 selector를 동시에 적용

5. descendant selector 자손 셀렉터
p span{ color: red; }
=> 자손을 모두 찾는다
--------------------------------------------------------------------------
6. child selector 자식 셀렉터
p>span{ color:red; }
=> 자식을 찾는다. 바로 한단계 아래 셀레터를 찾는다.

7. Adjacent Sibling Selector 
div+p{ color:red; }
=> 같은 level의 selector(형제) 중에서 바로 다음(adjacent) 순서를 찾는다.

8. General Sibling Selector
div~p{ color:red; }
=> 같은 level의 selector(형제)를 모두 찾는다.
--------------------------------------------------------------------------------------

'TIS_2020 > 빅데이터2020_1기' 카테고리의 다른 글

10/12 layout04.html  (0) 2020.10.12
10/08 layout03  (0) 2020.10.08
10/7 html_workspace  (0) 2020.10.07
join.html  (0) 2020.10.07
student, book, bookrent  (0) 2020.10.06
Comments