728x90

static

  • default position
  • top,right,bottom,up 에 영향을 받지않고 정적으로 배치됨

relative

  • static 위치를 기준으로 offset attribute value(top,right,bottom,up) 만큼 상대적으로 이동
  • offset attribute value가 없다면 초기 position은 의미상으로 static과 같아지게 된다.

absolute

  • ancestor 요소를 기준으로 위치를 설정한다.
    • ancestor 요소는 위치가 설정된 ancestor 요소인 relative, fixed, absolute의 position을 가지는 요소를 의미
    • 만약 위치가 설정된 ancestor 요소가 없다면 body를 기준으로 움직이게 된다.
  • offset attribute value가 없다면 초기 position은 의미상으로 static과 같아지게 된다.

fixed

  • viewport를 기준으로 상대적으로 위치한다.
  • offset attribute value가 없다면 초기 position은 의미상으로 static과 같아지게 된다.

'CSS' 카테고리의 다른 글

6. 위치 속성 CSS - 정렬  (0) 2020.12.01
5. CSS 위치 속성 - float, clear, overflow  (0) 2020.11.30
3. 위치 속성 정보 - display  (0) 2020.11.25
2.CSS 많이쓰이는 문법 & 규칙  (0) 2020.11.23
1. CSS  (0) 2020.11.23

+ Recent posts