min-width
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.
min-width CSS ìì±ì ììì ìµì ëë¹ë¥¼ ì¤ì í©ëë¤. min-widthë width ìì±ì ì¬ì©ê°ì´ ìì ì ê°ë³´ë¤ ììì§ë걸 ë°©ì§í©ëë¤.
ìëí´ ë³´ê¸°
min-width: 150px;
min-width: 20em;
min-width: 75%;
min-width: 40ch;
<section class="default-example" id="default-example">
<div class="transition-all" id="example-element">
Change the minimum width.
</div>
</section>
#example-element {
display: flex;
flex-direction: column;
background-color: #5b6dcd;
height: 80%;
justify-content: center;
color: #ffffff;
}
min-widthê° max-width ëë widthë³´ë¤ ì»¤ì§ë©´ ììì ëë¹ë min-widthì ê°ì ì¬ì©í©ëë¤.
구문
/* <length> ê° */
min-width: 3.5em;
/* <percentage> ê° */
min-width: 10%;
/* í¤ìë ê° */
min-width: max-content;
min-width: min-content;
min-width: fit-content;
min-width: fill-available;
/* ì ì ê° */
min-width: inherit;
min-width: initial;
min-width: unset;
ê°
<length>- : ê³ ì 길ì´ë¡ ëíë¸ ìµë ëë¹. ìì ê°ì ì í¨íì§ ììµëë¤.
<percentage>- : 컨í ì´ë ë¸ë¡ ëë¹ì ëí ë°±ë¶ì¨ë¡ ëíë¸ ìµë ëë¹. ìì ê°ì ì í¨íì§ ììµëë¤.
í¤ìë ê°
auto-
ìµì ëë¹ë¥¼ ì íì§ ìì.
max-content-
본ì§ì ì¸ ì í¸ ëì´.
min-content-
본ì§ì ì¸ ìµì ëì´.
fill-available-
컨í ì´ë ë¸ë¡ì ëë¹ìì ê°ë¡ì¶ ì쪽 ë° ë°ê¹¥ ì¬ë°±ê³¼ í ë리ì ê³µê°ì ì ì¸í ëì´. (ì¼ë¶ ë¸ë¼ì°ì ë ë§¤ì° ì¤ë ë ì´ë¦ì¸
availableë¡ êµ¬íí¨ì ì°¸ê³ íì¸ì.) fit-content-
min(max-content, max(min-content, fill-available))ê³¼ ê°ì.
íì 구문
min-width =
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-width: 75%;
}
form {
min-width: 0;
}
ëª ì¸
| Specification |
|---|
| CSS Box Sizing Module Level 4 > # sizing-values > |
| ì´ê¸°ê° | auto |
|---|---|
| ì ì©ëì | all elements but non-replaced inline elements, table rows, and row groups |
| ìì | no |
| Percentages | refer to the width of the containing block |
| ê³ì° ê° | the percentage as specified or the absolute length |
| Animation type | a length, percentage or calc(); |