margin-bottom
Baseline Widely available *
This feature is well established and works across many devices and browser versions. It’s been available across browsers since July 2015.
* Some parts of this feature may have varying levels of support.
시도해 보기
margin-bottom: 1em;
margin-bottom: 10%;
margin-bottom: 10px;
margin-bottom: 0;
#container {
width: 300px;
height: 200px;
display: flex;
align-content: flex-start;
flex-direction: column;
justify-content: flex-start;
}
.row {
height: 33.33%;
display: inline-block;
border: solid #ce7777 10px;
background-color: #2b3a55;
flex-shrink: 0;
}
#example-element {
border: solid 10px #ffbf00;
background-color: #2b3a55;
}
,
등 비대체non-replaced 인라인 요소에는 효과가 없습니다.
구문
css
/* 값 */
margin-bottom: 10px; /* 절대 길이 */
margin-bottom: 1em; /* 글씨 크기에 상대적 */
margin-bottom: 5%; /* 가장 가까운 블록 컨테이너의 너비에 상대적 */
/* 키워드 값 */
margin-bottom: auto;
/* 전역 값 */
margin-bottom: inherit;
margin-bottom: initial;
margin-bottom: unset;
margin-bottom
속성은 키워드 auto
,
,
를 사용해 설정할 수 있습니다. 값은 양수, 0, 음수가 가능합니다.
값
형식 구문
예제
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 . |
상속 | no |
Percentages | refer to the width of the containing block |
계산 값 | the percentage as specified or the absolute length |
Animation type | a length |