Movatterモバイル変換


[0]ホーム

URL:


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

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

View in EnglishAlways switch to English

padding-top

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-topCSS 속성은 요소의 위쪽에안쪽 여백 영역을 설정합니다.

시도해 보기

padding-top: 1em;
padding-top: 10%;
padding-top: 20px;
padding-top: 1ch;
padding-top: 0;
<section>  <div>    <div>      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;}

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

The effect of the CSS padding-top property on the element box

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

구문

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

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

<length>

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

<percentage>

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

형식 구문

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

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

예제

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

명세

Specification
CSS Box Model Module Level 3
# padding-physical
초기값0
적용대상all elements, excepttable-row-group,table-header-group,table-footer-group,table-row,table-column-group andtable-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 typealength

브라우저 호환성

같이 보기

Help improve MDN

Learn how to contribute

This page was last modified on byMDN contributors.


[8]ページ先頭

©2009-2026 Movatter.jp