[CSS] 수직/수평 정렬
IT/HTML, CSS 2020. 12. 30. 12:19

- block의 경우 (예를 들어, div) margin: auto로 수평 center 가능하다. (수직으로는 불가능) ​ - text-align의 경우 요소를 수평 center 가능하지만 수직으로는 불가능하다. 블록 요소에는 적용이 안 된다. ​ -transform: translate(50%, 50%) translate(x축, y축)이다. 50씩 이동하므로 완전한 center. ​ -텍스트인 경우 text-align: center line-height: __px (__에는 부모 상자의 height 만큼 넣어주면 된다.) ​ ​ ​ 그냥 justify-content를 사용하도록 하자... developer.mozilla.org/en-US/docs/Web/CSS/justify-content justify-..