min-height
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ì.
* Some parts of this feature may have varying levels of support.
max-height CSS ìì±ì ììì ìµì ëì´ë¥¼ ì¤ì í©ëë¤. min-heightë height ìì±ì ì¬ì©ê°ì´ ìì ì ê°ë³´ë¤ ììì§ë걸 ë°©ì§í©ëë¤.
ìëí´ ë³´ê¸°
min-height: 150px;
min-height: 7em;
min-height: 75%;
min-height: 10px;
<section class="default-example" id="default-example">
<div class="transition-all" id="example-element">
This is a box where you can change the minimum height. <br />If there is
more content than the minimum the box will grow to the height needed by the
content.
</div>
</section>
#example-element {
display: flex;
flex-direction: column;
background-color: #5b6dcd;
justify-content: center;
color: #ffffff;
}
min-heightê° max-height ëë heightë³´ë¤ ì»¤ì§ë©´ ììì ëì´ë min-heightì ê°ì ì¬ì©í©ëë¤.
구문
/* <length> ê° */
min-height: 3.5em;
/* <percentage> ê° */
min-height: 10%;
/* í¤ìë ê° */
min-height: max-content;
min-height: min-content;
min-height: fit-content;
min-height: fill-available;
/* ì ì ê° */
min-height: inherit;
min-height: initial;
min-height: unset;
ê°
<length>- : ê³ ì 길ì´ë¡ ëíë¸ ìµë ëì´. ìì ê°ì ì í¨íì§ ììµëë¤.
<percentage>- : 컨í ì´ë ë¸ë¡ ëì´ì ëí ë°±ë¶ì¨ë¡ ëíë¸ ìµë ëì´. ìì ê°ì ì í¨íì§ ììµëë¤.
í¤ìë ê°
auto-
ìµì ëì´ë¥¼ ì íì§ ìì.
max-content-
본ì§ì ì¸ ì í¸ ëì´.
min-content-
본ì§ì ì¸ ìµì ëì´.
fill-available-
컨í ì´ë ë¸ë¡ì ëì´ìì ì¸ë¡ì¶ ì쪽 ë° ë°ê¹¥ ì¬ë°±ê³¼ í ë리ì ê³µê°ì ì ì¸í ëì´. (ì¼ë¶ ë¸ë¼ì°ì ë ë§¤ì° ì¤ë ë ì´ë¦ì¸
availableë¡ êµ¬íí¨ì ì°¸ê³ íì¸ì.) fit-content-
CSS3 Box 모ëì ë°ë¼
min-contentì ë¤ë¥¸ ì´ë¦. CSS3 Sizing 모ëì ë ë³µì¡í ìê³ ë¦¬ì¦ì ì ìíì§ë§, 모ë ë¸ë¼ì°ì ìì ì¤í 기ë¥ì¼ë¡ë 구ííì§ ììµëë¤.
íì 구문
min-height =
auto |
<length-percentage [0,â]> |
min-content |
max-content |
fit-content( <length-percentage [0,â]> ) |
<calc-size()> |
<anchor-size()> |
stretch |
fit-content |
contain
<length-percentage> =
<length> |
<percentage>
<calc-size()> =
calc-size( <calc-size-basis> , <calc-sum> )
<anchor-size()> =
anchor-size( [ <anchor-name> || <anchor-size> ]? , <length-percentage>? )
<calc-size-basis> =
<size-keyword> |
<calc-size()> |
any |
<calc-sum>
<calc-sum> =
<calc-product> [ [ '+' | '-' ] <calc-product> ]*
<anchor-name> =
<dashed-ident>
<anchor-size> =
width |
height |
block |
inline |
self-block |
self-inline
<calc-product> =
<calc-value> [ [ '*' | / ] <calc-value> ]*
<calc-value> =
<number> |
<dimension> |
<percentage> |
<calc-keyword> |
( <calc-sum> )
<calc-keyword> =
e |
pi |
infinity |
-infinity |
NaN
ìì
table {
min-height: 75%;
}
form {
min-height: 0;
}
ëª ì¸
| Specification |
|---|
| CSS Box Sizing Module Level 4 > # sizing-values > |
| ì´ê¸°ê° | auto |
|---|---|
| ì ì©ëì | all elements but non-replaced inline elements, table columns, and column groups |
| ìì | no |
| Percentages | The percentage is calculated with respect to the height of the generated box's containing block. If the height of the containing block is not specified explicitly (i.e., it depends on content height), and this element is not absolutely positioned, the percentage value is treated as 0. |
| ê³ì° ê° | the percentage as specified or the absolute length |
| Animation type | a length, percentage or calc(); |