CSS_ transform(변환)

tuna·2021년 8월 3일
0

CSS

목록 보기
3/3
post-thumbnail

transform

  • 요소를 변환시켜주는 속성

transform: 변환함수1 변환함수2 변환함수3 ... ;
transform: 원근법 이동 크기 회전 기울임;


💙 2D 변환 함수

함수효과단위자주 사용됨
translate(x, y)이동(x축, y축)pxo
translateX(x)이동(x축)pxo
translateY(y)이동(y축)pxo
scale(x, y)크기(x축, y축)없음(배수)o
scaleX(x)크기(x축)없음(배수)
scaleY(y)크기(y축)없음(배수)
rotate(degree)회전(각도)dego
skew(x, y)기울임(x축, y축)deg
skewX(x)기울임(x축)dego
skewY(y)기울임(y축)dego
matrix(n,n,n,n,n,n)2차원 변환 효과

💙 3D 변환 함수

함수효과단위자주 사용됨
translateZ(z)이동(z축)px
translate3d(x, y, z)이동(x축, y축, z축)px
scaleZ(z)크기(z축)없음(배수)
scale3d(x, y, z)크기(x축, y축, z축)없음(배수)
perspective(n)원근법(거리)pxo
rotateX(x)회전(x축)dego
rotateY(y)회전(y축)dego
rotateZ(z)회전(z축)deg
rotate3d(x, y, z, a)회전(x축, y축, z축, 각도)deg
matrix3d(n, n, n, n, n, n, n, n, n, n, n, n, n, n, n, n)3차원 변환 효과
  • 원근법 함수는 제일 앞에 작성해야 함!

📢 perspective 속성과 함수 차이점

perspective: 하위 요소를 관찰하는 원근 거리를 지정(px 등으로 단위 지정)

속성 / 함수적용 대상기준점 설정
perspective: 600px;관찰 대상의 부모perspective-origin
transform: perspective(600px)관찰 대상transform-origin


📢 backface-visibility 속성

backface-visibility: 3D 변환으로 회전된 요소의 뒷면 숨김 여부

효과
visible뒷면 보임
hidden뒷면 숨김


출처 - 이 포스트는 패스트 캠퍼스의 강의를 참고하여 작성하였습니다.

profile
프론트엔드 공부 정리

0개의 댓글