The max-width property sets the maximum width of an element's box. The actual width will not exceed this value. Percentages refer to the containing block's width..limited {
max-width: 600px;
}.fluid {
width: 100%;
max-width: min(80ch, 90vw);
}min:0max:9999step:1units:% | px | em | rem | vw | vhnoneNo maximum width (default value).min-contentShrink the box to the smallest possible content width.max-contentUse the largest content width (without wrapping).fit-contentFunction value: combines min-content and max-content given the available space.fit-content()fit-content(<length-percentage>) — constrains width by the given length within content constraints.calc()Computes a value from a math expression, e.g. calc(100% - 2rem).CSS Box Sizing Module Level 3Editor's Draft<length-percentage>W3CMDNCSSShow all codeEdit CSS onlineThe plugin that remembers hundreds of CSS items for youEvery CSS property — in a live demonstrationThe bilingual CSS referencedefinitionexamplessyntaxmodulespecificationvalue typessourcesvisual demonstrationpreviousnext