예시 콘텐츠가 차지할 수 있는 고유한 크기는 배치 방식에 따라 달라질 수 있습니다.
/* 길이 값으로 사용됨 */
width: max-content;
min-width: max-content;
max-width: max-content;
height: max-content;
min-height: max-content;
max-height: max-content;
flex-basis: max-content;

/* 그리드 트랙에서 사용됨 */
grid-template-columns: 150px 1fr max-content;
<div class="container">
    <p>text</p>
    <p>There's a very looooooooooooon g text</p>
</div>
.container {
    width: 200px;
    background-color: silver;
    border: 5px dashed red;
}
p {
    width: max-content;
    background-color: gold;
}
실제 적용된 모습
<div class="control-unit">
    <label for="user-id">사용자 아이디</label>
    <input type="text" id="user-id">
</div>
.control-unit {
    box-sizing: border-box;
    width: max-content;
    max-width: 100%;
    background-color: gold;
    padding: 1em;
}
실제 적용된 모습
<div class="grid-container">
    <div class="grid-item">Item</div>
    <div class="grid-item">Item with more text in it.</div>
    <div class="grid-item">max-content item</div>
</div>
.grid-container {
    display: grid;
    grid-template-columns: auto auto max-content;
    gap: 10px;
    background-color: lightgray;
}
.grid-item {
    padding: 10px;
    background-color: gold;
}
실제 적용된 모습
<h4>height: max-content</h4>
<div class="parent">
    <div class="child max-content-item">height의 max-content</div>
    <div class="child max-content-item">height의 max-content 값의 이해</div>
    <div class="child max-content-item">
        height의 max-content 값은 그 콘텐츠가
        차지하는 최적의 충분한 높이만큼 요소의 크기를
        맞추는 역할을 합니다.
    </div>
</div>
<h4>height: auto</h4>
<div class="parent">
    <div class="child auto-item">height의 max-content</div>
    <div class="child auto-item">height의 max-content 값의 이해</div>
    <div class="child auto-item">
        height의 max-content 값은 그 콘텐츠가
        차지하는 최적의 충분한 높이만큼 요소의 크기를
        맞추는 역할을 합니다.
    </div>
</div>
.parent {
    display: flex; /* Flexbox 사용 */
    align-items: stretch;
    background-color: silver;
    border: 5px dashed red;
    gap: 10px;
    padding: 10px;
}
.child {
    width: 120px; /* 모든 요소에 동일한 너비 적용 */
    background-color: gold;
    border: 1px solid navy;
    padding: 5px;
}
.max-content-item {
    height: max-content; /* 콘텐츠가 차지하는 최적의 충분한 높이만큼만 */
}
.auto-item {
    height: auto;
}
실제 적용된 모습
selector {
    width: calc(max-content + 50px); /* 유효하지 않은 속성 값입니다. */
}

caniuse.com에서 더 자세한 정보를 확인해 보세요.