margin-bottom
시도해보기
구문
css
/* <length> 값 */
margin-bottom: 10px; /* 절대 길이 */
margin-bottom: 1em; /* 글씨 크기에 상대적 */
margin-bottom: 5%; /* 가장 가까운 블록 컨테이너의 너비에 상대적 */
/* 키워드 값 */
margin-bottom: auto;
/* 전역 값 */
margin-bottom: inherit;
margin-bottom: initial;
margin-bottom: unset;
margin-bottom 속성은 키워드 auto, <length>, <percentage>를 사용해 설정할 수 있습니다. 값은 양수, 0, 음수가 가능합니다.
값
<length>-
바깥 여백 크기의 고정 값.
<percentage>-
바깥 여백 크기와 블록 컨테이너 너비의 비율.
auto-
브라우저가 적절한 값 선택.
margin을 참고하세요.
형식 구문
margin-bottom =
<length-percentage> |
auto
<length-percentage> =
<length> |
<percentage>
예제
css
.content { margin-bottom: 5%; }
.sidebox { margin-bottom: 10px; }
.logo { margin-bottom: -5px; }
#footer { margin-bottom: 1em; }
명세
| Specification |
|---|
| CSS Box Model Module Level 3 # margin-physical |
| 초기값 | 0 |
|---|---|
| 적용대상 | all elements, except elements with table display types other than table-caption, table and inline-table. It also applies to ::first-letter (en-US) and ::first-line (en-US). |
| 상속 | no |
| Percentages | refer to the width of the containing block |
| 계산 값 | the percentage as specified or the absolute length |
| Animation type | a length |
브라우저 호환성
BCD tables only load in the browser