공부
[CSS] padding-top: *%
승가비
2018. 6. 25. 18:40
728x90
[CSS] padding-top: *%
일하다가 알게된 꿀팁입니다.
padding-top: *% 인데요, 세로값이 크게 중요하지 않는 DOM에 세팅하는 값입니다.
가로의 비율을 가져와서 사용할 수 있어서 유용하네요 ㅎ.ㅎ
Syntax
/* <length> values */
padding-top: 0.5em;
padding-top: 0;
padding-top: 2cm;
/* <percentage> value */
padding-top: 10%;
/* Global values */
padding-top: inherit;
padding-top: initial;
padding-top: unset;
The padding-top
property is specified as a single value chosen from the list below. Unlike margins, negative values are not allowed for padding.
Values
<length>
- The size of the padding as a fixed value. Must be nonnegative.
<percentage>
- The size of the padding as a percentage, relative to the width of the containing block. Must be nonnegative.
[출처] https://developer.mozilla.org/en-US/docs/Web/CSS/padding-top
728x90