1. 개발자를 위한 웹 기술
  2. CSS
  3. CSS 참고서
  4. Properties
  5. padding-left

This page was translated from English by the community. Learn more and join the MDN Web Docs community.

View in English Always switch to English

padding-left

Baseline Widely available

This feature is well established and works across many devices and browser versions. It’s been available across browsers since 2015년 7월.

padding-left CSS 속성은 요소의 왼쪽에 안쪽 여백 영역을 설정합니다.

시도해 보기

padding-left: 1.5em;
padding-left: 10%;
padding-left: 20px;
padding-left: 1ch;
padding-left: 0;
<section id="default-example">
 <div class="transition-all" id="example-element">
 <div class="box">
 Far out in the uncharted backwaters of the unfashionable end of the
 western spiral arm of the Galaxy lies a small unregarded yellow sun.
 </div>
 </div>
</section>
#example-element {
 border: 10px solid #ffc129;
 overflow: hidden;
 text-align: left;
}
.box {
 border: dashed 1px;
}

요소의 안쪽 여백 영역은 콘텐츠와 테두리 사이의 공간입니다.

참고 : padding 속성을 사용하면 하나의 선언으로 네 방향 여백을 모두 설정할 수 있습니다.

구문

css
/* <length> 값 */
padding-left: 0.5em;
padding-left: 0;
padding-left: 2cm;
/* <percentage> 값 */
padding-left: 10%;
/* 전역 값 */
padding-left: inherit;
padding-left: initial;
padding-left: unset;

padding-left 속성의 값은 아래 목록 중 하나로 지정할 수 있습니다. 바깥 여백margin과 다르게, 음수 값은 사용할 수 없습니다.

<length>

여백의 크기로 고정값 사용.

<percentage>

여백의 크기로 컨테이닝 블록 너비의 백분율 사용.

형식 구문

padding-left = 
<length-percentage [0,∞]>

<length-percentage> =
<length> |
<percentage>

예제

css
.content {
 padding-left: 5%;
}
.sidebox {
 padding-left: 10px;
}

명세

Specification
CSS Box Model Module Level 3
# padding-physical
초기값 0
적용대상all elements, except table-row-group, table-header-group, table-footer-group, table-row, table-column-group and table-column. It also applies to ::first-letter and ::first-line.
상속 no
Percentagesrefer to the width of the containing block
계산 값 the percentage as specified or the absolute length
Animation type a length

브라우저 호환성

같이 보기

Help improve MDN

Learn how to contribute

This page was last modified on by MDN contributors.

AltStyle によって変換されたページ (->オリジナル) /