LANGUAGE

SEOUL‍
language:css

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
language:css [2023/05/31 16:32] – 바깥 편집 127.0.0.1language:css [2024/04/28 23:08] (current) – 제거됨 clockoon
Line 1: Line 1:
-<!DOCTYPE markdown> 
- 
-CSS 
-==== 
- 
-## selectors 
-### first-child / first-of-type 
-CSS를 사용할 때 많이 혼동하지만, `first-child`는 element의 절대적인 위치를 나타낸다. 즉, 자식 element 중 '해당하는' 요소의 첫 번째가 아니라, '모든' 요소의 첫 번째를 가리킨다. 전자를 지정하기 위해서는 `first-of-type`을 사용해야 한다. 예를 들어, 
- 
-```css 
-<div class="parent"> 
-  <h1>Child</h1>   <!-- h1:first-child, h1:first-of-type --> 
-  <div>Child</div> <!-- div:nth-child(2), div:first-of-type --> 
-  <div>Child</div> 
-  <div>Child</div> 
-</div> 
-``` 
- 
-즉 `div:first-child`는 아무런 div도 가리키지 않는다[^1]. 
- 
-## Tips 
-내용이 많아지면 [[:language:css:tips]]로 옮겨서 작성. 
- 
-[^1]: 출처: https://stackoverflow.com/questions/24657555/what-is-the-difference-between-first-child-and-first-of-type/24657721#24657721 
----- struct data ---- 
-pageinfo.status      : Draft 
----- 
  
language/css.1685518361.txt.gz · Last modified: (external edit)