
https://www.codeit.kr/community/threads/2385
코딩이 처음이라면, 코드잇
월 3만원대로 Python, JavaScript, HTML/CSS, Java 등 1,600개 이상 프로그래밍 강의를 무제한 수강하세요
www.codeit.kr:443
margin top bottom 이 auto이면 0으로 잡는다고 한다.

https://www.w3.org/TR/CSS21/visudet.html#inline-replaced-height
Visual formatting model details
The position and size of an element's box(es) are sometimes calculated relative to a certain rectangle, called the containing block of the element. The containing block of an element is defined as follows: In paged media, an absolutely positioned element i
www.w3.org
중앙정렬일 경우 flex를 사용해 적용 가능하다.
하지만 오래된 브라우저를 지원해야 한다면 margin: 0 auto;를 대신 사용해야한다고 명시되어있다.

https://developer.mozilla.org/ko/docs/Web/CSS/margin
margin - CSS: Cascading Style Sheets | MDN
margin CSS 속성은 요소의 네 방향 바깥 여백 영역을 설정합니다. margin-top, margin-right, margin-bottom, margin-left의 단축 속성입니다.
developer.mozilla.org
가운데 정렬하는 방법
https://codingbroker.tistory.com/60
[HTML, CSS] div 자식 요소 가운데 정렬하는 방법 - margin, text-align, flexbox
HTML에서 div 내에 있는 자식 div를 가운데 정렬하는 방법입니다 여러가지 방법이 있지만 자주 쓰이는 3가지 방법으로 진행해보겠습니다. margin text-align flexbox 다음과 같이 outer div와 자식요소인 inner
codingbroker.tistory.com
'개발관련 > front-end' 카테고리의 다른 글
마우스 드래그 javascript (0) | 2022.04.14 |
---|---|
JSTL quick reference 작성중, el tag, core tag, forEach (0) | 2022.04.14 |
자바스크립트 anchor 사용하는 방법 여러가지 관련 사이트 (0) | 2021.10.27 |
javaScript에 excel 파일 가져오기 및 내보내기 관련 링크 (0) | 2021.10.06 |
[jquery]serializeArray() serialize() 차이 (0) | 2021.09.29 |