오늘보다 더 나은 내일

[수업노트](20.10.26)D+12 absolute정렬/transform-translate x, translate y/position-fixed 본문

국비지원 UX UI 디자인/코딩 수업

[수업노트](20.10.26)D+12 absolute정렬/transform-translate x, translate y/position-fixed

papiliofly 2020. 11. 1. 15:58
728x90

1. position- absolute 정렬/translate x, translate y

 - 수평 중앙정렬: block요소 처럼 {margin: 0 auto;}
 - 수직 중앙정렬: {margin: auto 0;} = 불가능
 - 수직 수평 중앙정렬: 
   1. {top, left: 50%;} → 중앙 쯤이지만 좌측 상단 꼭지점 기준이므로 세부 위치 조정 필요
    {transform: translate x: -50%, translate y: -50%; }  자기 넓이의 반akszma왼쪽이동, 자기 높이의 반 만큼 위로 이동
   2. {top:x % left: x % bottom: x % right: x % ;}  그러나 넓이가 유동적이다
   3. {top:x px left: x px bottom: x px right: x px ;}  그러나 넓이가 유동적이다


2. position- static, relative, absolute, fixed

  static relative absolute fixed
너비 유지 최대한 줄어든다
본질 사람 사람,유령의 집 유령,유령의 집 유령,유령의 집
스크롤바 따라다님
겹침 불가능(주변 영향을 줌) 가능(주변 영향을 주지 않음)
이동 - top, left, right, bottom으로 이동

- 자식은 부모엘리먼트를 유령으로 인식하지 않는다

728x90