CINXE.COM

CSS Box Sizing Module Level 3

<!doctype html><html lang="en"> <head> <meta content="text/html; charset=utf-8" http-equiv="Content-Type"> <meta content="width=device-width, initial-scale=1, shrink-to-fit=no" name="viewport"> <title>CSS Box Sizing Module Level 3</title> <meta content="ED" name="w3c-status"> <link href="https://www.w3.org/StyleSheets/TR/2021/W3C-ED" rel="stylesheet"> <meta content="Bikeshed version 60c422380, updated Thu Feb 20 19:11:22 2025 -0800" name="generator"> <link href="https://www.w3.org/TR/css-sizing-3/" rel="canonical"> <link href="https://drafts.csswg.org/csslogo.ico" rel="icon"> <meta content="00a4565adc80e6981e7fdefb92480d41c0f5ffea" name="revision"> <meta content="dark light" name="color-scheme"> <link href="https://www.w3.org/StyleSheets/TR/2021/dark.css" media="(prefers-color-scheme: dark)" rel="stylesheet" type="text/css"> <style> table.data th[scope=row] { text-align: right; text-align: end; } </style> <style>/* Boilerplate: style-autolinks */ .css.css, .property.property, .descriptor.descriptor { color: var(--a-normal-text); font-size: inherit; font-family: inherit; } .css::before, .property::before, .descriptor::before { content: "‘"; } .css::after, .property::after, .descriptor::after { content: "’"; } .property, .descriptor { /* Don't wrap property and descriptor names */ white-space: nowrap; } .type { /* CSS value <type> */ font-style: italic; } pre .property::before, pre .property::after { content: ""; } [data-link-type="property"]::before, [data-link-type="propdesc"]::before, [data-link-type="descriptor"]::before, [data-link-type="value"]::before, [data-link-type="function"]::before, [data-link-type="at-rule"]::before, [data-link-type="selector"]::before, [data-link-type="maybe"]::before { content: "‘"; } [data-link-type="property"]::after, [data-link-type="propdesc"]::after, [data-link-type="descriptor"]::after, [data-link-type="value"]::after, [data-link-type="function"]::after, [data-link-type="at-rule"]::after, [data-link-type="selector"]::after, [data-link-type="maybe"]::after { content: "’"; } [data-link-type].production::before, [data-link-type].production::after, .prod [data-link-type]::before, .prod [data-link-type]::after { content: ""; } [data-link-type=element], [data-link-type=element-attr] { font-family: Menlo, Consolas, "DejaVu Sans Mono", monospace; font-size: .9em; } [data-link-type=element]::before { content: "<" } [data-link-type=element]::after { content: ">" } [data-link-type=biblio] { white-space: pre; } @media (prefers-color-scheme: dark) { :root { --selflink-text: black; --selflink-bg: silver; --selflink-hover-text: white; } } </style> <style>/* Boilerplate: style-caniuse-panel */ @media (max-width: 767px) { .caniuse-status { opacity: .1; transition: opacity .1s; } } :root { --caniuse-bg: #EEE; --caniuse-shadow: #999; --caniuse-nosupport-text: #ccc; --caniuse-partialsupport-text: #666; } @media (prefers-color-scheme: dark) { :root { --caniuse-bg: #222; --caniuse-shadow: #444; --caniuse-nosupport-text: #666; --caniuse-partialsupport-text: #bbb; } } .caniuse-status { background: var(--caniuse-bg, #EEE); border-radius: .25em; box-shadow: 0 0 3px var(--caniuse-shadow, #999); color: var(--text, black); font: 1em sans-serif; hyphens: none; max-width: min-content; overflow: hidden; padding: .2em; position: absolute; right: 0.3em; top: auto; width: fit-content; word-wrap: normal; z-index: 8; } .caniuse-status.unpositioned { display: none; } .caniuse-status.overlapping-main { opacity: .2; transition: opacity .1s; } .caniuse-status[open] { opacity: 1; z-index: 9; min-width: 9em; width: fit-content; } .caniuse-status:hover { outline: var(--text, black) 1px solid; opacity: 1; } .caniuse-status > summary { font-weight: normal; text-align: right; cursor: pointer; display: block; } .caniuse-status > p { font-size: 0.6em; margin: 0; padding: 0; clear: both; } .caniuse-status > p + p { padding-top: 0.5em; } .caniuse-status > .support { display: block; } .caniuse-status > .support > span { padding: 0.2em 0; display: block; display: table; } .caniuse-status > .support > span.partial { color: var(--caniuse-partialsupport-text, #666666); filter: grayscale(50%); } .caniuse-status > .support > span.no { color: var(--caniuse-nosupport-text, #CCCCCC); filter: grayscale(100%); } .caniuse-status > .support > span.no::before { opacity: 0.5; } .caniuse-status > .support > span:first-of-type { padding-top: 0.5em; } .caniuse-status > .support > span > span { padding: 0 0.5em; display: table-cell; vertical-align: top; } .caniuse-status > .support > span > span:first-child { width: 100%; } .caniuse-status > .support > span > span:last-child { width: 100%; white-space: pre; padding: 0; } .caniuse-status > .support > span::before { content: ' '; display: table-cell; height: 1.5em; background: no-repeat center center; background-size: contain; text-align: right; font-size: 0.75em; font-weight: bold; } .caniuse-status > .support > .and_chr::before { background-image: url(https://resources.whatwg.org/browser-logos/chrome.svg); } .caniuse-status > .support > .and_ff::before { background-image: url(https://resources.whatwg.org/browser-logos/firefox.png); } .caniuse-status > .support > .and_uc::before { background-image: url(https://resources.whatwg.org/browser-logos/uc.png); } /* UC Browser for Android */ .caniuse-status > .support > .android::before { background-image: url(https://resources.whatwg.org/browser-logos/android.svg); } .caniuse-status > .support > .bb::before { background-image: url(https://resources.whatwg.org/browser-logos/bb.jpg); } /* Blackberry Browser */ .caniuse-status > .support > .chrome::before { background-image: url(https://resources.whatwg.org/browser-logos/chrome.svg); } .caniuse-status > .support > .edge::before { background-image: url(https://resources.whatwg.org/browser-logos/edge.svg); } .caniuse-status > .support > .firefox::before { background-image: url(https://resources.whatwg.org/browser-logos/firefox.png); } .caniuse-status > .support > .ie::before { background-image: url(https://resources.whatwg.org/browser-logos/ie.png); } .caniuse-status > .support > .ie_mob::before { background-image: url(https://resources.whatwg.org/browser-logos/ie-mobile.svg); } .caniuse-status > .support > .ios_saf::before { background-image: url(https://resources.whatwg.org/browser-logos/safari-ios.svg); } .caniuse-status > .support > .op_mini::before { background-image: url(https://resources.whatwg.org/browser-logos/opera-mini.png); } .caniuse-status > .support > .op_mob::before { background-image: url(https://resources.whatwg.org/browser-logos/opera.svg); } .caniuse-status > .support > .opera::before { background-image: url(https://resources.whatwg.org/browser-logos/opera.svg); } .caniuse-status > .support > .safari::before { background-image: url(https://resources.whatwg.org/browser-logos/safari.png); } .caniuse-status > .support > .samsung::before { background-image: url(https://resources.whatwg.org/browser-logos/samsung.svg); } .caniuse-status > .caniuse { text-align: right; font-style: italic; } @media (max-width: 767px) { .caniuse-status.wrapped { width: 9em; height: auto; } .caniuse-status:not(.wrapped) { height: 1em; max-width: min-content; } .caniuse-status.wrapped > :not(input) { display: block; } .caniuse-status:not(.wrapped) > :not(input) { display: none; } } </style> <style>/* Boilerplate: style-colors */ /* Any --*-text not paired with a --*-bg is assumed to have a transparent bg */ :root { color-scheme: light dark; --text: black; --bg: white; --unofficial-watermark: url(https://www.w3.org/StyleSheets/TR/2016/logos/UD-watermark); --logo-bg: #1a5e9a; --logo-active-bg: #c00; --logo-text: white; --tocnav-normal-text: #707070; --tocnav-normal-bg: var(--bg); --tocnav-hover-text: var(--tocnav-normal-text); --tocnav-hover-bg: #f8f8f8; --tocnav-active-text: #c00; --tocnav-active-bg: var(--tocnav-normal-bg); --tocsidebar-text: var(--text); --tocsidebar-bg: #f7f8f9; --tocsidebar-shadow: rgba(0,0,0,.1); --tocsidebar-heading-text: hsla(203,20%,40%,.7); --toclink-text: var(--text); --toclink-underline: #3980b5; --toclink-visited-text: var(--toclink-text); --toclink-visited-underline: #054572; --heading-text: #005a9c; --hr-text: var(--text); --algo-border: #def; --del-text: red; --del-bg: transparent; --ins-text: #080; --ins-bg: transparent; --a-normal-text: #034575; --a-normal-underline: #bbb; --a-visited-text: var(--a-normal-text); --a-visited-underline: #707070; --a-hover-bg: rgba(75%, 75%, 75%, .25); --a-active-text: #c00; --a-active-underline: #c00; --blockquote-border: silver; --blockquote-bg: transparent; --blockquote-text: currentcolor; --issue-border: #e05252; --issue-bg: #fbe9e9; --issue-text: var(--text); --issueheading-text: #831616; --example-border: #e0cb52; --example-bg: #fcfaee; --example-text: var(--text); --exampleheading-text: #574b0f; --note-border: #52e052; --note-bg: #e9fbe9; --note-text: var(--text); --noteheading-text: hsl(120, 70%, 30%); --notesummary-underline: silver; --assertion-border: #aaa; --assertion-bg: #eee; --assertion-text: black; --advisement-border: orange; --advisement-bg: #fec; --advisement-text: var(--text); --advisementheading-text: #b35f00; --warning-border: red; --warning-bg: hsla(40,100%,50%,0.95); --warning-text: var(--text); --amendment-border: #330099; --amendment-bg: #F5F0FF; --amendment-text: var(--text); --amendmentheading-text: #220066; --def-border: #8ccbf2; --def-bg: #def; --def-text: var(--text); --defrow-border: #bbd7e9; --datacell-border: silver; --indexinfo-text: #707070; --indextable-hover-text: black; --indextable-hover-bg: #f7f8f9; --outdatedspec-bg: rgba(0, 0, 0, .5); --outdatedspec-text: black; --outdated-bg: maroon; --outdated-text: white; --outdated-shadow: red; --editedrec-bg: darkorange; } @media (prefers-color-scheme: dark) { :root { --text: #ddd; --bg: black; --unofficial-watermark: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='400' height='400'%3E%3Cg fill='%23100808' transform='translate(200 200) rotate(-45) translate(-200 -200)' stroke='%23100808' stroke-width='3'%3E%3Ctext x='50%25' y='220' style='font: bold 70px sans-serif; text-anchor: middle; letter-spacing: 6px;'%3EUNOFFICIAL%3C/text%3E%3Ctext x='50%25' y='305' style='font: bold 70px sans-serif; text-anchor: middle; letter-spacing: 6px;'%3EDRAFT%3C/text%3E%3C/g%3E%3C/svg%3E"); --logo-bg: #1a5e9a; --logo-active-bg: #c00; --logo-text: white; --tocnav-normal-text: #999; --tocnav-normal-bg: var(--bg); --tocnav-hover-text: var(--tocnav-normal-text); --tocnav-hover-bg: #080808; --tocnav-active-text: #f44; --tocnav-active-bg: var(--tocnav-normal-bg); --tocsidebar-text: var(--text); --tocsidebar-bg: #080808; --tocsidebar-shadow: rgba(255,255,255,.1); --tocsidebar-heading-text: hsla(203,20%,40%,.7); --toclink-text: var(--text); --toclink-underline: #6af; --toclink-visited-text: var(--toclink-text); --toclink-visited-underline: #054572; --heading-text: #8af; --hr-text: var(--text); --algo-border: #456; --del-text: #f44; --del-bg: transparent; --ins-text: #4a4; --ins-bg: transparent; --a-normal-text: #6af; --a-normal-underline: #555; --a-visited-text: var(--a-normal-text); --a-visited-underline: var(--a-normal-underline); --a-hover-bg: rgba(25%, 25%, 25%, .2); --a-active-text: #f44; --a-active-underline: var(--a-active-text); --borderedblock-bg: rgba(255, 255, 255, .05); --blockquote-border: silver; --blockquote-bg: var(--borderedblock-bg); --blockquote-text: currentcolor; --issue-border: #e05252; --issue-bg: var(--borderedblock-bg); --issue-text: var(--text); --issueheading-text: hsl(0deg, 70%, 70%); --example-border: hsl(50deg, 90%, 60%); --example-bg: var(--borderedblock-bg); --example-text: var(--text); --exampleheading-text: hsl(50deg, 70%, 70%); --note-border: hsl(120deg, 100%, 35%); --note-bg: var(--borderedblock-bg); --note-text: var(--text); --noteheading-text: hsl(120, 70%, 70%); --notesummary-underline: silver; --assertion-border: #444; --assertion-bg: var(--borderedblock-bg); --assertion-text: var(--text); --advisement-border: orange; --advisement-bg: #222218; --advisement-text: var(--text); --advisementheading-text: #f84; --warning-border: red; --warning-bg: hsla(40,100%,20%,0.95); --warning-text: var(--text); --amendment-border: #330099; --amendment-bg: #080010; --amendment-text: var(--text); --amendmentheading-text: #cc00ff; --def-border: #8ccbf2; --def-bg: #080818; --def-text: var(--text); --defrow-border: #136; --datacell-border: silver; --indexinfo-text: #aaa; --indextable-hover-text: var(--text); --indextable-hover-bg: #181818; --outdatedspec-bg: rgba(255, 255, 255, .5); --outdatedspec-text: black; --outdated-bg: maroon; --outdated-text: white; --outdated-shadow: red; --editedrec-bg: darkorange; } /* In case a transparent-bg image doesn't expect to be on a dark bg, which is quite common in practice... */ img { background: white; } } </style> <style>/* Boilerplate: style-counters */ body { counter-reset: example figure issue; } .issue { counter-increment: issue; } .issue:not(.no-marker)::before { content: "Issue " counter(issue); } .example { counter-increment: example; } .example:not(.no-marker)::before { content: "Example " counter(example); } .invalid.example:not(.no-marker)::before, .illegal.example:not(.no-marker)::before { content: "Invalid Example" counter(example); } figcaption { counter-increment: figure; } figcaption:not(.no-marker)::before { content: "Figure " counter(figure) " "; } </style> <style>/* Boilerplate: style-dfn-panel */ :root { --dfnpanel-bg: #ddd; --dfnpanel-text: var(--text); --dfnpanel-target-bg: #ffc; --dfnpanel-target-outline: orange; } @media (prefers-color-scheme: dark) { :root { --dfnpanel-bg: #222; --dfnpanel-text: var(--text); --dfnpanel-target-bg: #333; --dfnpanel-target-outline: silver; } } .dfn-panel { position: absolute; z-index: 35; width: 20em; width: 300px; height: auto; max-height: 500px; overflow: auto; padding: 0.5em 0.75em; font: small Helvetica Neue, sans-serif, Droid Sans Fallback; background: var(--dfnpanel-bg); color: var(--dfnpanel-text); border: outset 0.2em; white-space: normal; /* in case it's moved into a pre */ } .dfn-panel:not(.on) { display: none; } .dfn-panel * { margin: 0; padding: 0; text-indent: 0; } .dfn-panel > b { display: block; } .dfn-panel a { color: var(--dfnpanel-text); } .dfn-panel a:not(:hover) { text-decoration: none !important; border-bottom: none !important; } .dfn-panel a:focus { outline: 5px auto Highlight; outline: 5px auto -webkit-focus-ring-color; } .dfn-panel > b + b { margin-top: 0.25em; } .dfn-panel ul { padding: 0 0 0 1em; list-style: none; } .dfn-panel li a { max-width: calc(300px - 1.5em - 1em); overflow: hidden; text-overflow: ellipsis; } .dfn-panel.activated { display: inline-block; position: fixed; left: 8px; bottom: 2em; margin: 0 auto; max-width: calc(100vw - 1.5em - .4em - .5em); max-height: 30vh; transition: left 1s ease-out, bottom 1s ease-out; } .dfn-panel .link-item:hover { text-decoration: underline; } .dfn-panel .link-item .copy-icon { opacity: 0; } .dfn-panel .link-item:hover .copy-icon, .dfn-panel .link-item .copy-icon:focus { opacity: 1; } .dfn-panel .copy-icon { display: inline-block; margin-right: 0.5em; width: 0.85em; height: 1em; border-radius: 3px; background-color: #ccc; cursor: pointer; } .dfn-panel .copy-icon .icon { width: 100%; height: 100%; background-color: #fff; display: flex; justify-content: center; align-items: center; position: relative; } .dfn-panel .copy-icon .icon::before { content: ""; position: absolute; top: 0; left: 0; width: 100%; height: 100%; border: 1px solid black; background-color: #ccc; opacity: 0.25; transform: translate(3px, -3px); } .dfn-panel .copy-icon:active .icon::before { opacity: 1; } .dfn-paneled[role="button"] { cursor: help; } .highlighted { animation: target-fade 3s; } @keyframes target-fade { from { background-color: var(--dfnpanel-target-bg); outline: 5px solid var(--dfnpanel-target-outline); } to { color: var(--a-normal-text); background-color: transparent; outline: transparent; } } </style> <style>/* Boilerplate: style-issues */ a[href].issue-return { float: right; float: inline-end; color: var(--issueheading-text); font-weight: bold; text-decoration: none; } </style> <style>/* Boilerplate: style-md-lists */ /* This is a weird hack for me not yet following the commonmark spec regarding paragraph and lists. */ [data-md] > :first-child { margin-top: 0; } [data-md] > :last-child { margin-bottom: 0; } </style> <style>/* Boilerplate: style-mdn-anno */ :root { --mdn-bg: #EEE; --mdn-shadow: #999; --mdn-nosupport-text: #ccc; --mdn-pass: green; --mdn-fail: red; } @media (prefers-color-scheme: dark) { :root { --mdn-bg: #222; --mdn-shadow: #444; --mdn-nosupport-text: #666; --mdn-pass: #690; --mdn-fail: #d22; } } .mdn-anno { background: var(--mdn-bg, #EEE); border-radius: .25em; box-shadow: 0 0 3px var(--mdn-shadow, #999); color: var(--text, black); font: 1em sans-serif; hyphens: none; max-width: min-content; overflow: hidden; padding: 0.2em; position: absolute; right: 0.3em; top: auto; white-space: nowrap; word-wrap: normal; z-index: 8; } .mdn-anno.unpositioned { display: none; } .mdn-anno.overlapping-main { opacity: .2; transition: opacity .1s; } .mdn-anno[open] { opacity: 1; z-index: 9; min-width: 9em; } .mdn-anno:hover { opacity: 1; outline: var(--text, black) 1px solid; } .mdn-anno > summary { font-weight: normal; text-align: right; cursor: pointer; display: block; } .mdn-anno > summary > .less-than-two-engines-flag { color: var(--mdn-fail); padding-right: 2px; } .mdn-anno > summary > .all-engines-flag { color: var(--mdn-pass); padding-right: 2px; } .mdn-anno > summary > span { color: #fff; background-color: #000; font-weight: normal; font-family: zillaslab, Palatino, "Palatino Linotype", serif; padding: 2px 3px 0px 3px; line-height: 1.3em; vertical-align: top; } .mdn-anno > .feature { margin-top: 20px; } .mdn-anno > .feature:not(:first-of-type) { border-top: 1px solid #999; margin-top: 6px; padding-top: 2px; } .mdn-anno > .feature > .less-than-two-engines-text { color: var(--mdn-fail); } .mdn-anno > .feature > .all-engines-text { color: var(--mdn-pass); } .mdn-anno > .feature > p { font-size: .75em; margin-top: 6px; margin-bottom: 0; } .mdn-anno > .feature > p + p { margin-top: 3px; } .mdn-anno > .feature > .support { display: block; font-size: 0.6em; margin: 0; padding: 0; margin-top: 2px; } .mdn-anno > .feature > .support + div { padding-top: 0.5em; } .mdn-anno > .feature > .support > hr { display: block; border: none; border-top: 1px dotted #999; padding: 3px 0px 0px 0px; margin: 2px 3px 0px 3px; } .mdn-anno > .feature > .support > hr::before { content: ""; } .mdn-anno > .feature > .support > span { padding: 0.2em 0; display: block; display: table; } .mdn-anno > .feature > .support > span.no { color: var(--mdn-nosupport-text); filter: grayscale(100%); } .mdn-anno > .feature > .support > span.no::before { opacity: 0.5; } .mdn-anno > .feature > .support > span:first-of-type { padding-top: 0.5em; } .mdn-anno > .feature > .support > span > span { padding: 0 0.5em; display: table-cell; } .mdn-anno > .feature > .support > span > span:first-child { width: 100%; } .mdn-anno > .feature > .support > span > span:last-child { width: 100%; white-space: pre; padding: 0; } .mdn-anno > .feature > .support > span::before { content: ' '; display: table-cell; min-width: 1.5em; height: 1.5em; background: no-repeat center center; background-size: contain; text-align: right; font-size: 0.75em; font-weight: bold; } .mdn-anno > .feature > .support > .chrome_android::before { background-image: url(https://resources.whatwg.org/browser-logos/chrome.svg); } .mdn-anno > .feature > .support > .firefox_android::before { background-image: url(https://resources.whatwg.org/browser-logos/firefox.png); } .mdn-anno > .feature > .support > .chrome::before { background-image: url(https://resources.whatwg.org/browser-logos/chrome.svg); } .mdn-anno > .feature > .support > .edge_blink::before { background-image: url(https://resources.whatwg.org/browser-logos/edge.svg); } .mdn-anno > .feature > .support > .edge::before { background-image: url(https://resources.whatwg.org/browser-logos/edge_legacy.svg); } .mdn-anno > .feature > .support > .firefox::before { background-image: url(https://resources.whatwg.org/browser-logos/firefox.png); } .mdn-anno > .feature > .support > .ie::before { background-image: url(https://resources.whatwg.org/browser-logos/ie.png); } .mdn-anno > .feature > .support > .safari_ios::before { background-image: url(https://resources.whatwg.org/browser-logos/safari-ios.svg); } .mdn-anno > .feature > .support > .nodejs::before { background-image: url(https://nodejs.org/favicon.ico); } .mdn-anno > .feature > .support > .opera_android::before { background-image: url(https://resources.whatwg.org/browser-logos/opera.svg); } .mdn-anno > .feature > .support > .opera::before { background-image: url(https://resources.whatwg.org/browser-logos/opera.svg); } .mdn-anno > .feature > .support > .safari::before { background-image: url(https://resources.whatwg.org/browser-logos/safari.png); } .mdn-anno > .feature > .support > .samsunginternet_android::before { background-image: url(https://resources.whatwg.org/browser-logos/samsung.svg); } .mdn-anno > .feature > .support > .webview_android::before { background-image: url(https://resources.whatwg.org/browser-logos/android-webview.png); } .name-slug-mismatch { color: red; } .caniuse-status:hover { z-index: 9; } /* dt, li, .issue, .note, and .example are "position: relative", so to put annotation at right margin, must move to right of containing block */; .h-entry:not(.status-LS) dt > .mdn-anno, .h-entry:not(.status-LS) li > .mdn-anno, .h-entry:not(.status-LS) .issue > .mdn-anno, .h-entry:not(.status-LS) .note > .mdn-anno, .h-entry:not(.status-LS) .example > .mdn-anno { right: -6.7em; } .h-entry p + .mdn-anno { margin-top: 0; } h2 + .mdn-anno.after { margin: -48px 0 0 0; } h3 + .mdn-anno.after { margin: -46px 0 0 0; } h4 + .mdn-anno.after { margin: -42px 0 0 0; } h5 + .mdn-anno.after { margin: -40px 0 0 0; } h6 + .mdn-anno.after { margin: -40px 0 0 0; } </style> <style>/* Boilerplate: style-ref-hints */ :root { --ref-hint-bg: #ddd; --ref-hint-text: var(--text); } @media (prefers-color-scheme: dark) { :root { --ref-hint-bg: #222; --ref-hint-text: var(--text); } } .ref-hint { display: inline-block; position: absolute; z-index: 35; width: 20em; width: 300px; height: auto; max-height: 500px; overflow: auto; padding: 0.5em 0.5em; font: small Helvetica Neue, sans-serif, Droid Sans Fallback; background: var(--ref-hint-bg); color: var(--ref-hint-text); border: outset 0.2em; white-space: normal; /* in case it's moved into a pre */ } .ref-hint * { margin: 0; padding: 0; text-indent: 0; } .ref-hint ul { padding: 0 0 0 1em; list-style: none; } </style> <style>/* Boilerplate: style-selflinks */ :root { --selflink-text: white; --selflink-bg: gray; --selflink-hover-text: black; } .heading, .issue, .note, .example, li, dt { position: relative; } a.self-link { position: absolute; top: 0; left: calc(-1 * (3.5rem - 26px)); width: calc(3.5rem - 26px); height: 2em; text-align: center; border: none; transition: opacity .2s; opacity: .5; } a.self-link:hover { opacity: 1; } .heading > a.self-link { font-size: 83%; } .example > a.self-link, .note > a.self-link, .issue > a.self-link { /* These blocks are overflow:auto, so positioning outside doesn't work. */ left: auto; right: 0; } li > a.self-link { left: calc(-1 * (3.5rem - 26px) - 2em); } dfn > a.self-link { top: auto; left: auto; opacity: 0; width: 1.5em; height: 1.5em; background: var(--selflink-bg); color: var(--selflink-text); font-style: normal; transition: opacity .2s, background-color .2s, color .2s; } dfn:hover > a.self-link { opacity: 1; } dfn > a.self-link:hover { color: var(--selflink-hover-text); } a.self-link::before { content: "¶"; } .heading > a.self-link::before { content: "§"; } dfn > a.self-link::before { content: "#"; } </style> <style>/* Boilerplate: style-syntax-highlighting */ code.highlight { padding: .1em; border-radius: .3em; } pre.highlight, pre > code.highlight { display: block; padding: 1em; margin: .5em 0; overflow: auto; border-radius: 0; } .highlight:not(.idl) { background: rgba(0, 0, 0, .03); } c-[a] { color: #990055 } /* Keyword.Declaration */ c-[b] { color: #990055 } /* Keyword.Type */ c-[c] { color: #708090 } /* Comment */ c-[d] { color: #708090 } /* Comment.Multiline */ c-[e] { color: #0077aa } /* Name.Attribute */ c-[f] { color: #669900 } /* Name.Tag */ c-[g] { color: #222222 } /* Name.Variable */ c-[k] { color: #990055 } /* Keyword */ c-[l] { color: #000000 } /* Literal */ c-[m] { color: #000000 } /* Literal.Number */ c-[n] { color: #0077aa } /* Name */ c-[o] { color: #999999 } /* Operator */ c-[p] { color: #999999 } /* Punctuation */ c-[s] { color: #a67f59 } /* Literal.String */ c-[t] { color: #a67f59 } /* Literal.String.Single */ c-[u] { color: #a67f59 } /* Literal.String.Double */ c-[cp] { color: #708090 } /* Comment.Preproc */ c-[c1] { color: #708090 } /* Comment.Single */ c-[cs] { color: #708090 } /* Comment.Special */ c-[kc] { color: #990055 } /* Keyword.Constant */ c-[kn] { color: #990055 } /* Keyword.Namespace */ c-[kp] { color: #990055 } /* Keyword.Pseudo */ c-[kr] { color: #990055 } /* Keyword.Reserved */ c-[ld] { color: #000000 } /* Literal.Date */ c-[nc] { color: #0077aa } /* Name.Class */ c-[no] { color: #0077aa } /* Name.Constant */ c-[nd] { color: #0077aa } /* Name.Decorator */ c-[ni] { color: #0077aa } /* Name.Entity */ c-[ne] { color: #0077aa } /* Name.Exception */ c-[nf] { color: #0077aa } /* Name.Function */ c-[nl] { color: #0077aa } /* Name.Label */ c-[nn] { color: #0077aa } /* Name.Namespace */ c-[py] { color: #0077aa } /* Name.Property */ c-[ow] { color: #999999 } /* Operator.Word */ c-[mb] { color: #000000 } /* Literal.Number.Bin */ c-[mf] { color: #000000 } /* Literal.Number.Float */ c-[mh] { color: #000000 } /* Literal.Number.Hex */ c-[mi] { color: #000000 } /* Literal.Number.Integer */ c-[mo] { color: #000000 } /* Literal.Number.Oct */ c-[sb] { color: #a67f59 } /* Literal.String.Backtick */ c-[sc] { color: #a67f59 } /* Literal.String.Char */ c-[sd] { color: #a67f59 } /* Literal.String.Doc */ c-[se] { color: #a67f59 } /* Literal.String.Escape */ c-[sh] { color: #a67f59 } /* Literal.String.Heredoc */ c-[si] { color: #a67f59 } /* Literal.String.Interpol */ c-[sx] { color: #a67f59 } /* Literal.String.Other */ c-[sr] { color: #a67f59 } /* Literal.String.Regex */ c-[ss] { color: #a67f59 } /* Literal.String.Symbol */ c-[vc] { color: #0077aa } /* Name.Variable.Class */ c-[vg] { color: #0077aa } /* Name.Variable.Global */ c-[vi] { color: #0077aa } /* Name.Variable.Instance */ c-[il] { color: #000000 } /* Literal.Number.Integer.Long */ @media (prefers-color-scheme: dark) { .highlight:not(.idl) { background: rgba(255, 255, 255, .05); } c-[a] { color: #d33682 } /* Keyword.Declaration */ c-[b] { color: #d33682 } /* Keyword.Type */ c-[c] { color: #2aa198 } /* Comment */ c-[d] { color: #2aa198 } /* Comment.Multiline */ c-[e] { color: #268bd2 } /* Name.Attribute */ c-[f] { color: #b58900 } /* Name.Tag */ c-[g] { color: #cb4b16 } /* Name.Variable */ c-[k] { color: #d33682 } /* Keyword */ c-[l] { color: #657b83 } /* Literal */ c-[m] { color: #657b83 } /* Literal.Number */ c-[n] { color: #268bd2 } /* Name */ c-[o] { color: #657b83 } /* Operator */ c-[p] { color: #657b83 } /* Punctuation */ c-[s] { color: #6c71c4 } /* Literal.String */ c-[t] { color: #6c71c4 } /* Literal.String.Single */ c-[u] { color: #6c71c4 } /* Literal.String.Double */ c-[ch] { color: #2aa198 } /* Comment.Hashbang */ c-[cp] { color: #2aa198 } /* Comment.Preproc */ c-[cpf] { color: #2aa198 } /* Comment.PreprocFile */ c-[c1] { color: #2aa198 } /* Comment.Single */ c-[cs] { color: #2aa198 } /* Comment.Special */ c-[kc] { color: #d33682 } /* Keyword.Constant */ c-[kn] { color: #d33682 } /* Keyword.Namespace */ c-[kp] { color: #d33682 } /* Keyword.Pseudo */ c-[kr] { color: #d33682 } /* Keyword.Reserved */ c-[ld] { color: #657b83 } /* Literal.Date */ c-[nc] { color: #268bd2 } /* Name.Class */ c-[no] { color: #268bd2 } /* Name.Constant */ c-[nd] { color: #268bd2 } /* Name.Decorator */ c-[ni] { color: #268bd2 } /* Name.Entity */ c-[ne] { color: #268bd2 } /* Name.Exception */ c-[nf] { color: #268bd2 } /* Name.Function */ c-[nl] { color: #268bd2 } /* Name.Label */ c-[nn] { color: #268bd2 } /* Name.Namespace */ c-[py] { color: #268bd2 } /* Name.Property */ c-[ow] { color: #657b83 } /* Operator.Word */ c-[mb] { color: #657b83 } /* Literal.Number.Bin */ c-[mf] { color: #657b83 } /* Literal.Number.Float */ c-[mh] { color: #657b83 } /* Literal.Number.Hex */ c-[mi] { color: #657b83 } /* Literal.Number.Integer */ c-[mo] { color: #657b83 } /* Literal.Number.Oct */ c-[sa] { color: #6c71c4 } /* Literal.String.Affix */ c-[sb] { color: #6c71c4 } /* Literal.String.Backtick */ c-[sc] { color: #6c71c4 } /* Literal.String.Char */ c-[dl] { color: #6c71c4 } /* Literal.String.Delimiter */ c-[sd] { color: #6c71c4 } /* Literal.String.Doc */ c-[se] { color: #6c71c4 } /* Literal.String.Escape */ c-[sh] { color: #6c71c4 } /* Literal.String.Heredoc */ c-[si] { color: #6c71c4 } /* Literal.String.Interpol */ c-[sx] { color: #6c71c4 } /* Literal.String.Other */ c-[sr] { color: #6c71c4 } /* Literal.String.Regex */ c-[ss] { color: #6c71c4 } /* Literal.String.Symbol */ c-[fm] { color: #268bd2 } /* Name.Function.Magic */ c-[vc] { color: #cb4b16 } /* Name.Variable.Class */ c-[vg] { color: #cb4b16 } /* Name.Variable.Global */ c-[vi] { color: #cb4b16 } /* Name.Variable.Instance */ c-[vm] { color: #cb4b16 } /* Name.Variable.Magic */ c-[il] { color: #657b83 } /* Literal.Number.Integer.Long */ } </style> <style>/* Boilerplate: style-wpt */ :root { --wpt-border: hsl(0, 0%, 60%); --wpt-bg: hsl(0, 0%, 95%); --wpt-text: var(--text); --wptheading-text: hsl(0, 0%, 30%); } @media (prefers-color-scheme: dark) { :root { --wpt-border: hsl(0, 0%, 30%); --wpt-bg: var(--borderedblock-bg); --wpt-text: var(--text); --wptheading-text: hsl(0, 0%, 60%); } } .wpt-tests-block { list-style: none; border-left: .5em solid var(--wpt-border); background: var(--wpt-bg); color: var(--wpt-text); margin: 1em auto; padding: .5em; } .wpt-tests-block summary { color: var(--wptheading-text); font-weight: normal; text-transform: uppercase; } .wpt-tests-block summary::marker{ color: var(--wpt-border); } .wpt-tests-block summary:hover::marker{ color: var(--wpt-text); } /* The only content of a wpt test block in its closed state is the <summary>, which contains the word TESTS, and that is absolutely positioned. In that closed state, wpt test blocks are styled to have a top margin whose height is exactly equal to the height of the absolutely positioned <summary>, and no other background/padding/margin/border. The wpt test block elements will therefore allow the maring of the previous/next block elements to collapse through them; if this combined margin would be larger than its own top margin, it stays as is, and therefore the pre-existing vertical rhythm of the document is undisturbed. If that combined margin would be smaller, it is grown to that size. This means that the wpt test block ensures that there's always enough vertical space to insert the summary, without adding more than is needed. */ .wpt-tests-block:not([open]){ padding: 0; border: none; background: none; font-size: 0.75em; line-height: 1; position: relative; margin: 1em 0 0; } .wpt-tests-block:not([open]) summary { position: absolute; right: 0; bottom: 0; } /* It is possible that both the last child of a block element and the block element itself would be annotated with a <wpt> block each. If the block element has a padding or a border, that's fine, but otherwise the bottom margin of the block and of its last child would collapse and both <wpt> elements would overlap, being both placed there. To avoid that, add 1px of padding to the <wpt> element annotating the last child to prevent the bottom margin of the block and of its last child from collapsing (and as much negative margin, as wel only want to prevent margin collapsing, but are not trying to actually take more space). */ .wpt-tests-block:not([open]):last-child { padding-bottom: 1px; margin-bottom: -1px; } /* Exception to the previous rule: don't do that in non-last list items, because it's not necessary, and would therefore consume more space than strictly needed. Lists must have list items as children, not <wpt> elements, so a <wpt> element cannot be a sibling of a list item, and the collision that the previous rule avoids cannot happen. */ li:not(:last-child) > .wpt-tests-block:not([open]):last-child, dd:not(:last-child) > .wpt-tests-block:not([open]):last-child { padding-bottom: 0; margin-bottom: 0; } .wpt-tests-block:not([open]):not(:hover){ opacity: 0.5; } .wpt-tests-list { list-style: none; display: grid; margin: 0; padding: 0; grid-template-columns: 1fr max-content auto auto; grid-column-gap: .5em; } .wpt-tests-block hr:last-child { display: none; } .wpt-test { display: contents; } .wpt-test > a { text-decoration: underline; border: none; } .wpt-test > .wpt-name { grid-column: 1; } .wpt-test > .wpt-results { grid-column: 2; } .wpt-test > .wpt-live { grid-column: 3; } .wpt-test > .wpt-source { grid-column: 4; } .wpt-test > .wpt-results { display: flex; gap: .1em; } .wpt-test .wpt-result { display: inline-block; height: 1em; width: 1em; border-radius: 50%; position: relative; } </style> <body class="h-entry"> <div class="head"> <p data-fill-with="logo"><a class="logo" href="https://www.w3.org/"> <img alt="W3C" height="48" src="https://www.w3.org/StyleSheets/TR/2021/logos/W3C" width="72"> </a> </p> <h1 class="p-name no-ref" id="title">CSS Box Sizing Module Level 3</h1> <p id="w3c-state"><a href="https://www.w3.org/standards/types/#ED">Editor’s Draft</a>, <time class="dt-updated" datetime="2024-07-25">25 July 2024</time></p> <details open> <summary>More details about this document</summary> <div data-fill-with="spec-metadata"> <dl> <dt>This version: <dd><a class="u-url" href="https://drafts.csswg.org/css-sizing-3/">https://drafts.csswg.org/css-sizing-3/</a> <dt>Latest published version: <dd><a href="https://www.w3.org/TR/css-sizing-3/">https://www.w3.org/TR/css-sizing-3/</a> <dt>Previous Versions: <dd><a href="https://www.w3.org/TR/2021/WD-css-sizing-3-20210317/" rel="prev">https://www.w3.org/TR/2021/WD-css-sizing-3-20210317/</a> <dd><a href="https://www.w3.org/TR/2020/WD-css-sizing-3-20201218/" rel="prev">https://www.w3.org/TR/2020/WD-css-sizing-3-20201218/</a> <dd><a href="https://www.w3.org/TR/2020/WD-css-sizing-3-20201023/" rel="prev">https://www.w3.org/TR/2020/WD-css-sizing-3-20201023/</a> <dd><a href="https://www.w3.org/TR/2019/WD-css-sizing-3-20190522/" rel="prev">https://www.w3.org/TR/2019/WD-css-sizing-3-20190522/</a> <dd><a href="https://www.w3.org/TR/2018/WD-css-sizing-3-20180304/" rel="prev">https://www.w3.org/TR/2018/WD-css-sizing-3-20180304/</a> <dd><a href="https://www.w3.org/TR/2017/WD-css-sizing-3-20170207/" rel="prev">https://www.w3.org/TR/2017/WD-css-sizing-3-20170207/</a> <dt>Feedback: <dd><a href="https://github.com/w3c/csswg-drafts/labels/css-sizing-3">CSSWG Issues Repository</a> <dd><a href="https://github.com/w3c/csswg-drafts/issues">CSSWG GitHub</a> <dd><a href="#issues-index">Inline In Spec</a> <dt class="editor">Editors: <dd class="editor p-author h-card vcard" data-editor-id="42199"><a class="p-name fn u-url url" href="http://xanthir.com/contact/">Tab Atkins</a> (<span class="p-org org">Google</span>) <dd class="editor p-author h-card vcard" data-editor-id="35400"><a class="p-name fn u-url url" href="http://fantasai.inkedblade.net/contact">Elika J. Etemad / fantasai</a> (<span class="p-org org">Apple</span>) <dt>Suggest an Edit for this Spec: <dd><a href="https://github.com/w3c/csswg-drafts/blob/main/css-sizing-3/Overview.bs">GitHub Editor</a> </dl> </div> </details> <div data-fill-with="warning"></div> <p class="copyright" data-fill-with="copyright"><a href="https://www.w3.org/policies/#copyright">Copyright</a> © 2024 <a href="https://www.w3.org/">World Wide Web Consortium</a>. <abbr title="World Wide Web Consortium">W3C</abbr><sup>®</sup> <a href="https://www.w3.org/policies/#Legal_Disclaimer">liability</a>, <a href="https://www.w3.org/policies/#W3C_Trademarks">trademark</a> and <a href="https://www.w3.org/copyright/software-license/" rel="license" title="W3C Software and Document License">permissive document license</a> rules apply. </p> <hr title="Separator for header"> </div> <div class="p-summary" data-fill-with="abstract"> <h2 class="no-num no-toc no-ref heading settled" id="abstract"><span class="content">Abstract</span></h2> <p>This module extends the CSS sizing properties with keywords that represent content-based "intrinsic" sizes and context-based "extrinsic" sizes, allowing CSS to more easily describe boxes that fit their content or fit into a particular layout context.</p> <a href="https://www.w3.org/TR/CSS/">CSS</a> is a language for describing the rendering of structured documents (such as HTML and XML) on screen, on paper, etc. <script> const githubPrefix = "https://w3c.github.io/csswg-drafts/"; if(location.href.slice(0, githubPrefix.length) == githubPrefix) { const suffix = location.href.slice(githubPrefix.length); const draftUrl = "https://drafts.csswg.org/" + suffix; window.location.replace(draftUrl); } </script> </div> <h2 class="no-num no-toc no-ref heading settled" id="sotd"><span class="content">Status of this document</span></h2> <div data-fill-with="status"> <p> This is a public copy of the editors’ draft. It is provided for discussion only and may change at any moment. Its publication here does not imply endorsement of its contents by W3C. Don’t cite this document other than as work in progress. </p> <p>Please send feedback by <a href="https://github.com/w3c/csswg-drafts/issues">filing issues in GitHub</a> (preferred), including the spec code “css-sizing” in the title, like this: “[css-sizing] <i>…summary of comment…</i>”. All issues and comments are <a href="https://lists.w3.org/Archives/Public/public-css-archive/">archived</a>. Alternately, feedback can be sent to the (<a href="https://lists.w3.org/Archives/Public/www-style/">archived</a>) public mailing list <a href="mailto:www-style@w3.org?Subject=%5Bcss-sizing%5D%20PUT%20SUBJECT%20HERE">www-style@w3.org</a>. </p> <p>This document is governed by the <a href="https://www.w3.org/policies/process/20231103/" id="w3c_process_revision">03 November 2023 W3C Process Document</a>. </p> </div> <div data-fill-with="at-risk"> <p>The following features are at-risk, and may be dropped during the CR period: </p> <ul> <li>Additions to <a class="property css" data-link-type="property" href="https://drafts.csswg.org/css-multicol-2/#propdef-column-width" id="ref-for-propdef-column-width">column-width</a> </ul> <p>“At-risk” is a W3C Process term-of-art, and does not necessarily imply that the feature is in danger of being dropped or delayed. It means that the WG believes the feature may have difficulty being interoperably implemented in a timely manner, and marking it as such allows the WG to drop the feature if necessary when transitioning to the Proposed Rec stage, without having to publish a new Candidate Rec without the feature first.</p> </div> <nav data-fill-with="table-of-contents" id="toc"> <h2 class="no-num no-toc no-ref" id="contents">Table of Contents</h2> <ol class="toc" role="directory"> <li> <a href="#intro"><span class="secno">1</span> <span class="content"> Introduction</span></a> <ol class="toc"> <li><a href="#placement"><span class="secno">1.1</span> <span class="content"> Module interactions</span></a> <li><a href="#values"><span class="secno">1.2</span> <span class="content"> Value Definitions</span></a> </ol> <li> <a href="#terms"><span class="secno">2</span> <span class="content"> Terminology</span></a> <ol class="toc"> <li><a href="#auto-box-sizes"><span class="secno">2.1</span> <span class="content"> Auto Box Sizes</span></a> <li><a href="#contributions"><span class="secno">2.2</span> <span class="content"> Intrinsic Size Contributions</span></a> <li><a href="#constraints"><span class="secno">2.3</span> <span class="content"> Intrinsic Size Constraints</span></a> </ol> <li> <a href="#specifying-sizes"><span class="secno">3</span> <span class="content"> Specifying Box Sizes</span></a> <ol class="toc"> <li> <a href="#sizing-properties"><span class="secno">3.1</span> <span class="content"> Sizing Properties</span></a> <ol class="toc"> <li><a href="#preferred-size-properties"><span class="secno">3.1.1</span> <span class="content"> Preferred Size Properties: the <span class="property">width</span> and <span class="property">height</span> properties</span></a> <li><a href="#min-size-properties"><span class="secno">3.1.2</span> <span class="content"> Minimum Size Properties: the <span class="property">min-width</span> and <span class="property">min-height</span> properties</span></a> <li><a href="#max-size-properties"><span class="secno">3.1.3</span> <span class="content"> Maximum Size Properties: the <span class="property">max-width</span> and <span class="property">max-height</span> properties</span></a> </ol> <li> <a href="#sizing-values"><span class="secno">3.2</span> <span class="content"> Sizing Values: the <span class="production">&lt;length-percentage [0,∞]></span>, <span class="css">auto</span> | <span class="css">none</span>, <span class="css">min-content</span>, <span class="css">max-content</span>, and <span class="css">fit-content()</span> values</span></a> <ol class="toc"> <li><a href="#behave-auto"><span class="secno">3.2.1</span> <span class="content"> “Behaving as <span class="css">auto</span>”</span></a> <li><a href="#the-contain-floats-value"><span class="secno">3.2.2</span> <span class="content"> Containing or Excluding Floats</span></a> </ol> <li><a href="#box-sizing"><span class="secno">3.3</span> <span class="content"> Box Edges for Sizing: the <span class="property">box-sizing</span> property</span></a> <li><a href="#column-sizing"><span class="secno">3.4</span> <span class="content"> New Column Sizing Values: the <span class="css">min-content</span>, <span class="css">max-content</span>, and <span class="css">fit-content()</span> values</span></a> </ol> <li> <a href="#extrinsic"><span class="secno">4</span> <span class="content"> Extrinsic Size Determination</span></a> <ol class="toc"> <li><a href="#percentage-sizing"><span class="secno">4.1</span> <span class="content"> Percentage Sizing</span></a> </ol> <li> <a href="#intrinsic"><span class="secno">5</span> <span class="content"> Intrinsic Size Determination</span></a> <ol class="toc"> <li><a href="#intrinsic-sizes"><span class="secno">5.1</span> <span class="content"> Intrinsic Sizes</span></a> <li> <a href="#intrinsic-contribution"><span class="secno">5.2</span> <span class="content"> Intrinsic Contributions</span></a> <ol class="toc"> <li><a href="#cyclic-percentage-contribution"><span class="secno">5.2.1</span> <span class="content"> Intrinsic Contributions of Percentage-Sized Boxes</span></a> <li><a href="#min-content-zero"><span class="secno">5.2.2</span> <span class="content"> Compressible Replaced Elements</span></a> </ol> </ol> <li> <a href="#changes"><span class="secno"></span> <span class="content"> Changes</span></a> <ol class="toc"> <li><a href="#changes-recent"><span class="secno"></span> <span class="content"> Recent Changes</span></a> <li><a href="#changes-3"><span class="secno"></span> <span class="content"> Additions since CSS Level 2</span></a> </ol> <li><a href="#acknowledgments"><span class="secno"></span> <span class="content"> Acknowledgments</span></a> <li><a href="#priv-sec"><span class="secno"></span> <span class="content"> Privacy and Security Considerations</span></a> <li> <a href="#w3c-conformance"><span class="secno"></span> <span class="content"> Conformance</span></a> <ol class="toc"> <li><a href="#w3c-conventions"><span class="secno"></span> <span class="content"> Document conventions</span></a> <li><a href="#w3c-conformance-classes"><span class="secno"></span> <span class="content"> Conformance classes</span></a> <li> <a href="#w3c-partial"><span class="secno"></span> <span class="content"> Partial implementations</span></a> <ol class="toc"> <li><a href="#w3c-conform-future-proofing"><span class="secno"></span> <span class="content"> Implementations of Unstable and Proprietary Features</span></a> </ol> <li><a href="#w3c-testing"><span class="secno"></span> <span class="content"> Non-experimental implementations</span></a> </ol> <li> <a href="#index"><span class="secno"></span> <span class="content">Index</span></a> <ol class="toc"> <li><a href="#index-defined-here"><span class="secno"></span> <span class="content">Terms defined by this specification</span></a> <li><a href="#index-defined-elsewhere"><span class="secno"></span> <span class="content">Terms defined by reference</span></a> </ol> <li> <a href="#references"><span class="secno"></span> <span class="content">References</span></a> <ol class="toc"> <li><a href="#normative"><span class="secno"></span> <span class="content">Normative References</span></a> <li><a href="#informative"><span class="secno"></span> <span class="content">Informative References</span></a> </ol> <li><a href="#property-index"><span class="secno"></span> <span class="content">Property Index</span></a> <li><a href="#issues-index"><span class="secno"></span> <span class="content">Issues Index</span></a> </ol> </nav> <main> <h2 class="heading settled" data-level="1" id="intro"><span class="secno">1. </span><span class="content"> Introduction</span><a class="self-link" href="#intro"></a></h2> <p><em>This section is not normative.</em> </p> <p> CSS layout has several different concepts of automatic sizing that are used in various layout calculations. This section defines some more precise terminology to help connect the layout behaviors of this spec to the calculations used in other modules, and some new keywords for the <a class="property css" data-link-type="property" href="#propdef-width" id="ref-for-propdef-width">width</a> and <a class="property css" data-link-type="property" href="#propdef-height" id="ref-for-propdef-height">height</a> properties to allow authors to assign elements the dimensions resulting from these size calculations. </p> <p class="issue" id="issue-664b2cc3"><a class="self-link" href="#issue-664b2cc3"></a> This spec needs illustrations! See <a href="https://github.com/w3c/csswg-drafts/issues/1938">issue</a>.</p> <h3 class="heading settled" data-level="1.1" id="placement"><span class="secno">1.1. </span><span class="content"> Module interactions</span><a class="self-link" href="#placement"></a></h3> <p>This module extends the <a class="property css" data-link-type="property" href="#propdef-width" id="ref-for-propdef-width①">width</a>, <a class="property css" data-link-type="property" href="#propdef-height" id="ref-for-propdef-height①">height</a>, <a class="property css" data-link-type="property" href="#propdef-min-width" id="ref-for-propdef-min-width">min-width</a>, <a class="property css" data-link-type="property" href="#propdef-min-height" id="ref-for-propdef-min-height">min-height</a>, <a class="property css" data-link-type="property" href="#propdef-max-width" id="ref-for-propdef-max-width">max-width</a>, <a class="property css" data-link-type="property" href="#propdef-max-height" id="ref-for-propdef-max-height">max-height</a>, and <a class="property css" data-link-type="property" href="https://drafts.csswg.org/css-multicol-2/#propdef-column-width" id="ref-for-propdef-column-width①">column-width</a> features defined in <a data-link-type="biblio" href="#biblio-css2" title="Cascading Style Sheets Level 2 Revision 1 (CSS 2.1) Specification">[CSS2]</a> chapter 10 and in <a data-link-type="biblio" href="#biblio-css3col" title="CSS Multi-column Layout Module Level 1">[CSS3COL]</a> </p> <p>The definition of the <a class="property css" data-link-type="property" href="#propdef-box-sizing" id="ref-for-propdef-box-sizing">box-sizing</a> property in this module supersedes the one in <a data-link-type="biblio" href="#biblio-css-ui-3" title="CSS Basic User Interface Module Level 3 (CSS3 UI)">[CSS-UI-3]</a>. </p> <h3 class="heading settled" data-level="1.2" id="values"><span class="secno">1.2. </span><span class="content"> Value Definitions</span><a class="self-link" href="#values"></a></h3> <p>This specification follows the <a href="https://www.w3.org/TR/CSS2/about.html#property-defs">CSS property definition conventions</a> from <a data-link-type="biblio" href="#biblio-css2" title="Cascading Style Sheets Level 2 Revision 1 (CSS 2.1) Specification">[CSS2]</a> using the <a href="https://www.w3.org/TR/css-values-3/#value-defs">value definition syntax</a> from <a data-link-type="biblio" href="#biblio-css-values-3" title="CSS Values and Units Module Level 3">[CSS-VALUES-3]</a>. Value types not defined in this specification are defined in CSS Values &amp; Units <span title="CSS Values and Units Module Level 3">[CSS-VALUES-3]</span>. Combination with other CSS modules may expand the definitions of these value types.</p> <p>In addition to the property-specific values listed in their definitions, all properties defined in this specification also accept the <a data-link-type="dfn" href="https://drafts.csswg.org/css-values-4/#css-wide-keywords" id="ref-for-css-wide-keywords">CSS-wide keywords</a> as their property value. For readability they have not been repeated explicitly.</p> <h2 class="heading settled" data-level="2" id="terms"><span class="secno">2. </span><span class="content"> Terminology</span><a class="self-link" href="#terms"></a></h2> <p>Some key terminology related to coordinate axises and dimensions is defined in <a href="https://drafts.csswg.org/css-writing-modes-3/#abstract-box"><cite>CSS Writing Modes 3</cite> § 6 Abstract Box Terminology</a>.</p> <dl> <dt><dfn class="dfn-paneled" data-dfn-type="dfn" data-export id="size">size</dfn> <dd> A one- or two-dimensional measurement: a <a data-link-type="dfn" href="https://drafts.csswg.org/css-writing-modes-4/#block-size" id="ref-for-block-size">block size</a> and/or <a data-link-type="dfn" href="https://drafts.csswg.org/css-writing-modes-4/#inline-size" id="ref-for-inline-size">inline size</a>; alternatively a <a data-link-type="dfn" href="#width" id="ref-for-width">width</a> and/or <a data-link-type="dfn" href="#height" id="ref-for-height">height</a>. <figure> <img alt="In left-to-right, top-to-bottom horizontal English, the horizontal width and inline size are synonymous, and vertical height and block size are synonymous." height="240" src="images/sizing-ltr-tb.svg" style="max-width: 49%;" width="420"><img alt="In top-to-bottom, right-to-left vertical Japanese, the horizontal width and block size are synonymous, and vertical height and inline size are synonymous." height="240" src="images/sizing-ttb-rl.svg" style="max-width: 49%;" width="420"> <figcaption>Whether the <a data-link-type="dfn" href="#width" id="ref-for-width①">width</a> or <a data-link-type="dfn" href="#height" id="ref-for-height①">height</a> corresponds to an <a data-link-type="dfn" href="https://drafts.csswg.org/css-writing-modes-4/#inline-size" id="ref-for-inline-size①">inline size</a> or <a data-link-type="dfn" href="https://drafts.csswg.org/css-writing-modes-4/#block-size" id="ref-for-block-size①">block size</a> depends on the <a data-link-type="dfn" href="https://drafts.csswg.org/css-writing-modes-4/#writing-mode" id="ref-for-writing-mode">writing mode</a>.</figcaption> </figure> <dt><dfn class="dfn-paneled" data-dfn-type="dfn" data-export data-lt="inner size|inner width|inner height|inner block size|inner inline size" id="inner-size">inner size</dfn> <dd> The <a href="https://www.w3.org/TR/css2/box.html#box-dimensions">content-box</a> <a data-link-type="dfn" href="#size" id="ref-for-size">size</a> of a <a data-link-type="dfn" href="https://drafts.csswg.org/css-display-3/#box" id="ref-for-box">box</a>. <figure> <img alt height="270" src="images/inner-size.svg" width="420"> <figcaption>Inner size</figcaption> </figure> <dt><dfn class="dfn-paneled" data-dfn-type="dfn" data-export data-lt="outer size|outer width|outer height|outer block size|outer inline size" id="outer-size">outer size</dfn> <dd> The <a href="https://www.w3.org/TR/css2/box.html#box-dimensions">margin-box</a> <a data-link-type="dfn" href="#size" id="ref-for-size①">size</a> of a <a data-link-type="dfn" href="https://drafts.csswg.org/css-display-3/#box" id="ref-for-box①">box</a>. <figure> <img alt height="270" src="images/outer-size.svg" width="420"> <figcaption>Outer size</figcaption> </figure> <dt><dfn class="dfn-paneled" data-dfn-type="dfn" data-export data-lt="definite|definite size" id="definite">definite size</dfn> <dd> A size that can be determined without performing layout; that is, a <a class="production css" data-link-type="type" href="https://drafts.csswg.org/css-values-4/#length-value" id="ref-for-length-value">&lt;length></a>, a measure of text (without consideration of line-wrapping), a size of the <a data-link-type="dfn" href="https://drafts.csswg.org/css-display-4/#initial-containing-block" id="ref-for-initial-containing-block">initial containing block</a>, or a <a class="production css" data-link-type="type" href="https://drafts.csswg.org/css-values-4/#percentage-value" id="ref-for-percentage-value">&lt;percentage></a> or other formula (such the <a href="https://www.w3.org/TR/CSS2/visudet.html#blockwidth">“stretch-fit” sizing of non-replaced blocks</a> <a data-link-type="biblio" href="#biblio-css2" title="Cascading Style Sheets Level 2 Revision 1 (CSS 2.1) Specification">[CSS2]</a>) that is resolved solely against <a data-link-type="dfn" href="#definite" id="ref-for-definite">definite</a> sizes. <p>Additionally, the size of the <a data-link-type="dfn" href="https://drafts.csswg.org/css-display-4/#containing-block" id="ref-for-containing-block">containing block</a> of an absolutely positioned element is always <a data-link-type="dfn" href="#definite" id="ref-for-definite①">definite</a> with respect to that element.</p> <dt><dfn class="dfn-paneled" data-dfn-type="dfn" data-export data-lt="indefinite|indefinite size" id="indefinite">indefinite size</dfn> <dd> A size that is not <a data-link-type="dfn" href="#definite" id="ref-for-definite②">definite</a>. <a data-link-type="dfn" href="#indefinite" id="ref-for-indefinite">Indefinite</a> <a data-link-type="dfn" href="#available" id="ref-for-available">available space</a> is essentially infinite. <p class="note" role="note"><span class="marker">Note:</span> <a data-link-type="dfn" href="#intrinsic-sizing" id="ref-for-intrinsic-sizing">intrinsic sizing</a> keywords such as <a class="css" data-link-type="maybe" href="#valdef-width-max-content" id="ref-for-valdef-width-max-content">max-content</a> are indefinite, even if they can be determined without laying out the children e.g. due to <a data-link-type="dfn" href="https://drafts.csswg.org/css-contain-2/#size-containment" id="ref-for-size-containment">size containment</a> or lack of children.</p> <dt><dfn class="dfn-paneled" data-dfn-type="dfn" data-export data-local-lt="available" data-lt="available space|available inline space|available block space" id="available">available space</dfn> <dd> A size representing the space into which a box is laid out, as determined by the rules of the formatting context in which it participates. The space available to a box is usually either a measurement of its <a data-link-type="dfn" href="https://drafts.csswg.org/css-display-4/#containing-block" id="ref-for-containing-block①">containing block</a> (if that is <a data-link-type="dfn" href="#definite" id="ref-for-definite③">definite</a>) or an infinite size (when it is <a data-link-type="dfn" href="#indefinite" id="ref-for-indefinite①">indefinite</a>). <a data-link-type="dfn" href="#available" id="ref-for-available①">Available space</a> can alternatively be either a <a data-link-type="dfn" href="#min-content-constraint" id="ref-for-min-content-constraint">min-content constraint</a> or a <a data-link-type="dfn" href="#max-content-constraint" id="ref-for-max-content-constraint">max-content constraint</a>, which forces boxes laid into it to be laid out under that constraint. <dt><dfn class="dfn-paneled" data-dfn-type="dfn" data-export id="stretch-fit">stretch fit</dfn> <dd> The <a data-link-type="dfn" href="#stretch-fit" id="ref-for-stretch-fit">stretch fit</a> into a given size is that size, minus the box’s computed margins (not collapsed, treating <span class="css">auto</span> as zero), border, and padding in the given dimension (such that the outer size is a perfect fit), and flooring at zero (so that the inner size is not negative). <p class="note" role="note"> Note: This is the formula used to calculate the <a class="css" data-link-type="maybe" href="#valdef-width-auto" id="ref-for-valdef-width-auto">auto</a> widths of non-replaced blocks in normal flow in <a href="https://www.w3.org/TR/CSS2/visudet.html#blockwidth">CSS2.1§10.3.3</a>. </p> <dt><dfn class="dfn-paneled" data-dfn-type="dfn" data-export data-lt="fallback|fallback size" id="fallback">fallback size</dfn> <dd> Some sizing algorithms do not work well with an infinite size. In these cases, the <a data-link-type="dfn" href="#fallback" id="ref-for-fallback">fallback size</a> is used instead. Unless otherwise specified, this is the size of the <a data-link-type="dfn" href="https://drafts.csswg.org/css-display-4/#initial-containing-block" id="ref-for-initial-containing-block①">initial containing block</a>. </dl> <h3 class="heading settled" data-level="2.1" id="auto-box-sizes"><span class="secno">2.1. </span><span class="content"> Auto Box Sizes</span><a class="self-link" href="#auto-box-sizes"></a></h3> <p>There are four types of automatically-determined sizes in CSS (sizes resulting from <a class="css" data-link-type="maybe" href="#valdef-width-auto" id="ref-for-valdef-width-auto①">auto</a> sizing rules, depending on context):</p> <dl> <dt><dfn class="dfn-paneled" data-dfn-type="dfn" data-export id="stretch-fit-size">stretch-fit size</dfn> <dt><dfn class="dfn-paneled" data-dfn-type="dfn" data-export id="stretch-fit-inline-size">stretch-fit inline size</dfn> <dt><dfn class="dfn-paneled" data-dfn-type="dfn" data-export id="stretch-fit-block-size">stretch-fit block size</dfn> <dd> The <a data-link-type="dfn" href="#size" id="ref-for-size②">size</a> a box would take if its <a data-link-type="dfn" href="#outer-size" id="ref-for-outer-size">outer size</a> filled the <a data-link-type="dfn" href="#available" id="ref-for-available②">available space</a> in the given axis; in other words, the <a data-link-type="dfn" href="#stretch-fit" id="ref-for-stretch-fit①">stretch fit</a> into the <span id="ref-for-available③">available space</span>, if that is <a data-link-type="dfn" href="#definite" id="ref-for-definite④">definite</a>. Undefined if the <span id="ref-for-available④">available space</span> is <a data-link-type="dfn" href="#indefinite" id="ref-for-indefinite②">indefinite</a>. <p class="note" role="note"><span class="marker">Note:</span> For the <a data-link-type="dfn" href="https://drafts.csswg.org/css-writing-modes-4/#inline-axis" id="ref-for-inline-axis">inline axis</a>, this is called the “available width” in <a href="https://www.w3.org/TR/CSS2/visudet.html#float-width">CSS2.1§10.3.5</a> and computed by the rules in <a href="https://www.w3.org/TR/CSS2/visudet.html#blockwidth">CSS2.1§10.3.3</a>.</p> <p class="note" role="note"><span class="marker">Note:</span> Calculations involving this size need to specify a fallback behavior for when the <a data-link-type="dfn" href="#available" id="ref-for-available⑤">available space</a> is <a data-link-type="dfn" href="#indefinite" id="ref-for-indefinite③">indefinite</a> if that happens to be possible.</p> <dt><dfn class="dfn-paneled" data-dfn-type="dfn" data-export data-lt="max-content | max-content size" id="max-content">max-content size</dfn> <dd> A box’s “ideal” <a data-link-type="dfn" href="#size" id="ref-for-size③">size</a> in a given axis when given infinite available space. Usually this is the smallest <span id="ref-for-size④">size</span> the box could take in that axis while still fitting around its contents, i.e. minimizing unfilled space while avoiding overflow. <dl> <dt data-md><dfn class="dfn-paneled" data-dfn-type="dfn" data-export id="max-content-inline-size">max-content inline size</dfn> <dd data-md> <p>The box’s “ideal” <a data-link-type="dfn" href="#size" id="ref-for-size⑤">size</a> in the <a data-link-type="dfn" href="https://drafts.csswg.org/css-writing-modes-4/#inline-axis" id="ref-for-inline-axis①">inline axis</a>. Usually the narrowest <a data-link-type="dfn" href="https://drafts.csswg.org/css-writing-modes-4/#inline-size" id="ref-for-inline-size②">inline size</a> it could take while fitting around its contents if <em>none</em> of the soft wrap opportunities within the box were taken. (See <a href="#intrinsic">§ 5 Intrinsic Size Determination</a>.)</p> <p class="note" role="note"><span class="marker">Note:</span> This is called the “preferred width” in <a href="https://www.w3.org/TR/CSS2/visudet.html#float-width">CSS2.1§10.3.5</a> and the “maximum cell width” in <a href="https://www.w3.org/TR/CSS2/tables.html#auto-table-layout">CSS2.1§17.5.2.2</a>.</p> <dt data-md><dfn class="dfn-paneled" data-dfn-type="dfn" data-export id="max-content-block-size">max-content block size</dfn> <dd data-md> <p>The box’s “ideal” <a data-link-type="dfn" href="#size" id="ref-for-size⑥">size</a> in the <a data-link-type="dfn" href="https://drafts.csswg.org/css-writing-modes-4/#block-axis" id="ref-for-block-axis">block axis</a>. Usually the <a data-link-type="dfn" href="https://drafts.csswg.org/css-writing-modes-4/#block-size" id="ref-for-block-size②">block size</a> of the content after layout.</p> </dl> <dt><dfn class="dfn-paneled" data-dfn-type="dfn" data-export data-lt="min-content | min-content size" id="min-content">min-content size</dfn> <dd> Nominally, the smallest <a data-link-type="dfn" href="#size" id="ref-for-size⑦">size</a> a box could take that doesn’t lead to overflow that could be avoided by choosing a larger <span id="ref-for-size⑧">size</span>. Formally, the size of the box when sized under a <a data-link-type="dfn" href="#min-content-constraint" id="ref-for-min-content-constraint①">min-content constraint</a>, see <a href="#intrinsic">§ 5 Intrinsic Size Determination</a>. <dl> <dt data-md><dfn class="dfn-paneled" data-dfn-type="dfn" data-export id="min-content-inline-size">min-content inline size</dfn> <dd data-md> <p>The <a data-link-type="dfn" href="#min-content" id="ref-for-min-content">min-content size</a> in the <a data-link-type="dfn" href="https://drafts.csswg.org/css-writing-modes-4/#inline-axis" id="ref-for-inline-axis②">inline axis</a>. Typically, the <a data-link-type="dfn" href="https://drafts.csswg.org/css-writing-modes-4/#inline-size" id="ref-for-inline-size③">inline size</a> that would fit around its contents if <em>all</em> soft wrap opportunities within the box were taken.</p> <p class="note" role="note"><span class="marker">Note:</span> This is called the “preferred minimum width” in <a href="https://www.w3.org/TR/CSS2/visudet.html#float-width">CSS2.1§10.3.5</a> and the “minimum content width” in <a href="https://www.w3.org/TR/CSS2/tables.html#auto-table-layout">CSS2.1§17.5.2.2</a>.</p> <dt data-md><dfn class="dfn-paneled" data-dfn-type="dfn" data-export id="min-content-block-size">min-content block size</dfn> <dd data-md> <p>The <a data-link-type="dfn" href="#min-content" id="ref-for-min-content①">min-content size</a> in the <a data-link-type="dfn" href="https://drafts.csswg.org/css-writing-modes-4/#block-axis" id="ref-for-block-axis①">block axis</a>. For <a data-link-type="dfn" href="https://drafts.csswg.org/css-display-4/#block-container" id="ref-for-block-container">block containers</a>, tables, and <a data-link-type="dfn" href="https://drafts.csswg.org/css-display-4/#inline-box" id="ref-for-inline-box">inline boxes</a>, this is equivalent to the <a data-link-type="dfn" href="#max-content-block-size" id="ref-for-max-content-block-size">max-content block size</a>.</p> </dl> <dt><dfn class="dfn-paneled" data-dfn-type="dfn" data-export id="fit-content-size">fit-content size</dfn> <dt><dfn class="dfn-paneled" data-dfn-type="dfn" data-export id="fit-content-inline-size">fit-content inline size</dfn> <dt><dfn class="dfn-paneled" data-dfn-type="dfn" data-export id="fit-content-block-size">fit-content block size</dfn> <dd> If the <a data-link-type="dfn" href="#available" id="ref-for-available⑥">available space</a> in a given axis is <a data-link-type="dfn" href="#definite" id="ref-for-definite⑤">definite</a>, equal to <code>clamp(<a data-link-type="dfn" href="#min-content" id="ref-for-min-content②">min-content size</a>, <a data-link-type="dfn" href="#stretch-fit-size" id="ref-for-stretch-fit-size">stretch-fit size</a>, <a data-link-type="dfn" href="#max-content" id="ref-for-max-content">max-content size</a>)</code> (i.e. <code>max(<a data-link-type="dfn" href="#min-content" id="ref-for-min-content③">min-content size</a>, min(<a data-link-type="dfn" href="#max-content" id="ref-for-max-content①">max-content size</a>, <a data-link-type="dfn" href="#stretch-fit-size" id="ref-for-stretch-fit-size①">stretch-fit size</a>))</code>). When sizing under a <a data-link-type="dfn" href="#min-content-constraint" id="ref-for-min-content-constraint②">min-content constraint</a>, equal to the <a data-link-type="dfn" href="#min-content" id="ref-for-min-content④">min-content size</a>. Otherwise, equal to the <a data-link-type="dfn" href="#max-content" id="ref-for-max-content②">max-content size</a> in that axis. <p class="note" role="note"><span class="marker">Note:</span> This is called the “shrink-to-fit” width in <a href="https://www.w3.org/TR/CSS2/visudet.html#float-width">CSS2.1§10.3.5</a> and <a href="https://www.w3.org/TR/css3-multicol/#pseudo-algorithm">CSS Multi-column Layout § 3.4</a>.</p> <dt><dfn class="dfn-paneled" data-dfn-type="dfn" data-export id="intrinsic-size">intrinsic size</dfn> <dd> A <a data-link-type="dfn" href="#max-content" id="ref-for-max-content③">max-content size</a> or <a data-link-type="dfn" href="#min-content" id="ref-for-min-content⑤">min-content size</a>, i.e. a size arising primarily from the size of the content. (Some uses of this term may refer also to sizes derived primarily from one of these two sizes.) <p><a data-link-type="dfn" href="https://drafts.csswg.org/css-display-4/#replaced-element" id="ref-for-replaced-element">Replaced elements</a> frequently derive their <a data-link-type="dfn" href="#intrinsic-size" id="ref-for-intrinsic-size">intrinsic size</a> from their <a data-link-type="dfn" href="https://drafts.csswg.org/css-images-3/#natural-dimensions" id="ref-for-natural-dimensions">natural dimensions</a>.</p> </dl> <h3 class="heading settled" data-level="2.2" id="contributions"><span class="secno">2.2. </span><span class="content"> Intrinsic Size Contributions</span><a class="self-link" href="#contributions"></a></h3> <dl> <dt><dfn class="dfn-paneled" data-dfn-type="dfn" data-export data-lt="max-content contribution|max-content inline-size contribution|max-content block-size contribution" id="max-content-contribution">max-content contribution</dfn> <dd> The size that a box contributes to its <a data-link-type="dfn" href="https://drafts.csswg.org/css-display-4/#containing-block" id="ref-for-containing-block②">containing block</a>’s <a data-link-type="dfn" href="#max-content" id="ref-for-max-content④">max-content size</a>. <dt><dfn class="dfn-paneled" data-dfn-type="dfn" data-export data-lt="min-content contribution|min-content inline-size contribution|min-content block-size contribution" id="min-content-contribution">min-content contribution</dfn> <dd> The size that a box contributes to its <a data-link-type="dfn" href="https://drafts.csswg.org/css-display-4/#containing-block" id="ref-for-containing-block③">containing block</a>’s <a data-link-type="dfn" href="#min-content" id="ref-for-min-content⑥">min-content size</a>. <dt><dfn class="dfn-paneled" data-dfn-type="dfn" data-export id="intrinsic-size-contribution">intrinsic size contribution</dfn> <dd> A <a data-link-type="dfn" href="#max-content-contribution" id="ref-for-max-content-contribution">max-content contribution</a>, <a data-link-type="dfn" href="#min-content-contribution" id="ref-for-min-content-contribution">min-content contribution</a>, or similarly-calculated content-based size contribution. </dl> <p>Intrinsic size contributions are based on the <a data-link-type="dfn" href="#outer-size" id="ref-for-outer-size①">outer size</a> of the box; for this purpose <span class="css">auto</span> margins are treated as zero.</p> <h3 class="heading settled dfn-paneled" data-dfn-type="dfn" data-export data-level="2.3" data-lt="intrinsic size constraint" id="constraints"><span class="secno">2.3. </span><span class="content"> Intrinsic Size Constraints</span><a class="self-link" href="#constraints" id="ref-for-constraints"></a></h3> <dl> <dt><dfn class="dfn-paneled" data-dfn-type="dfn" data-export id="max-content-constraint">max-content constraint</dfn> <dd> A sizing constraint imposed by the box’s <a data-link-type="dfn" href="https://drafts.csswg.org/css-display-4/#containing-block" id="ref-for-containing-block④">containing block</a> that causes it to produce its <a data-link-type="dfn" href="#max-content-contribution" id="ref-for-max-content-contribution①">max-content contribution</a>. <dt><dfn class="dfn-paneled" data-dfn-type="dfn" data-export id="min-content-constraint">min-content constraint</dfn> <dd> A sizing constraint imposed by the box’s <a data-link-type="dfn" href="https://drafts.csswg.org/css-display-4/#containing-block" id="ref-for-containing-block⑤">containing block</a> that causes it to produce its <a data-link-type="dfn" href="#min-content-contribution" id="ref-for-min-content-contribution①">min-content contribution</a>. <dt><dfn class="dfn-paneled" data-dfn-type="dfn" data-export id="preferred-aspect-ratio">preferred aspect ratio</dfn> <dd> A width:height ratio inherent to a box, which biases various sizing algorithms to produce a size consistent with that aspect ratio insofar as possible while honoring other sizing inputs. Unless otherwise specified, a box’s <a data-link-type="dfn" href="#preferred-aspect-ratio" id="ref-for-preferred-aspect-ratio">preferred aspect ratio</a> is its <a data-link-type="dfn" href="https://drafts.csswg.org/css-images-3/#natural-aspect-ratio" id="ref-for-natural-aspect-ratio">natural aspect ratio</a> if it has one and is applied to its <a data-link-type="dfn" href="https://drafts.csswg.org/css-box-4/#content-box" id="ref-for-content-box">content box</a>. Most boxes do not have a <span id="ref-for-preferred-aspect-ratio①">preferred aspect ratio</span>. </dl> <h2 class="heading settled" data-level="3" id="specifying-sizes"><span class="secno">3. </span><span class="content"> Specifying Box Sizes</span><span id="size-keywords"></span><a class="self-link" href="#specifying-sizes"></a></h2> <h3 class="heading settled" data-level="3.1" id="sizing-properties"><span class="secno">3.1. </span><span class="content"> Sizing Properties</span><a class="self-link" href="#sizing-properties"></a></h3> <p>This section defines the <dfn class="dfn-paneled" data-dfn-type="dfn" data-export data-lt="sizing property" id="sizing-property">sizing properties</dfn> <a class="property css" data-link-type="property" href="#propdef-width" id="ref-for-propdef-width②">width</a>, <a class="property css" data-link-type="property" href="#propdef-height" id="ref-for-propdef-height②">height</a>, <a class="property css" data-link-type="property" href="#propdef-min-width" id="ref-for-propdef-min-width①">min-width</a>, <a class="property css" data-link-type="property" href="#propdef-min-height" id="ref-for-propdef-min-height①">min-height</a>, <a class="property css" data-link-type="property" href="#propdef-max-width" id="ref-for-propdef-max-width①">max-width</a>, and <a class="property css" data-link-type="property" href="#propdef-max-height" id="ref-for-propdef-max-height①">max-height</a>. Their potential values are defined in the next section, <a href="#sizing-values">§ 3.2 Sizing Values: the &lt;length-percentage [0,∞]>, auto | none, min-content, max-content, and fit-content() values</a>.</p> <p class="note" role="note"><span class="marker">Note:</span> Additional <a data-link-type="dfn" href="https://drafts.csswg.org/css-writing-modes-4/#flow-relative" id="ref-for-flow-relative">flow-relative</a> aliases to these properties are defined in <a data-link-type="biblio" href="#biblio-css-logical-1" title="CSS Logical Properties and Values Level 1">[CSS-LOGICAL-1]</a>.</p> <p class="issue" id="issue-6eb2c542"><a class="self-link" href="#issue-6eb2c542"></a> We would like to define shorthands for each pair of sizing properties (e.g. <a class="property css" data-link-type="property" href="#propdef-width" id="ref-for-propdef-width③">width</a> and <a class="property css" data-link-type="property" href="#propdef-height" id="ref-for-propdef-height③">height</a>) but there is a naming conflict with the <a class="css" data-link-type="maybe" href="https://drafts.csswg.org/css-page-3/#at-ruledef-page" id="ref-for-at-ruledef-page">@page</a> <a class="property css" data-link-type="property">size</a> descriptor <a data-link-type="biblio" href="#biblio-css-page-3" title="CSS Paged Media Module Level 3">[CSS-PAGE-3]</a>, so this has been deferred to Level 4. Suggestions on how to resolve this problem are welcome, see <a href="https://github.com/w3c/csswg-drafts/issues/820">discussion</a>.</p> <h4 class="heading settled dfn-paneled" data-dfn-type="dfn" data-export data-level="3.1.1" data-lt="preferred size property" id="preferred-size-properties"><span class="secno">3.1.1. </span><span class="content"> Preferred Size Properties: the <a class="property css" data-link-type="property" href="#propdef-width" id="ref-for-propdef-width④">width</a> and <a class="property css" data-link-type="property" href="#propdef-height" id="ref-for-propdef-height④">height</a> properties</span><a class="self-link" href="#preferred-size-properties" id="ref-for-preferred-size-properties"></a></h4> <table class="def propdef" data-link-for-hint="width"> <tbody> <tr> <th>Name: <td><dfn class="dfn-paneled css" data-dfn-type="property" data-export id="propdef-width">width</dfn>, <dfn class="dfn-paneled css" data-dfn-type="property" data-export id="propdef-height">height</dfn> <tr class="value"> <th><a href="https://www.w3.org/TR/css-values/#value-defs">Value:</a> <td class="prod">auto <a data-link-type="grammar" href="https://drafts.csswg.org/css-values-4/#comb-one" id="ref-for-comb-one">|</a> <a class="production css" data-link-type="type" href="https://drafts.csswg.org/css-values-4/#typedef-length-percentage" id="ref-for-typedef-length-percentage">&lt;length-percentage [0,∞]></a> <span id="ref-for-comb-one①">|</span> min-content <span id="ref-for-comb-one②">|</span> max-content <span id="ref-for-comb-one③">|</span> <span style=";white-space:nowrap">fit-content(<a class="production css" data-link-type="type" href="https://drafts.csswg.org/css-values-4/#typedef-length-percentage" id="ref-for-typedef-length-percentage①">&lt;length-percentage [0,∞]></a>)</span> <span id="ref-for-comb-one④">|</span> <a class="production css" data-link-type="function" href="#funcdef-width-calc-size" id="ref-for-funcdef-width-calc-size">&lt;calc-size()></a> <tr> <th><a href="https://www.w3.org/TR/css-cascade/#initial-values">Initial:</a> <td>auto <tr> <th><a href="https://www.w3.org/TR/css-cascade/#applies-to">Applies to:</a> <td>all elements except <a data-link-type="dfn" href="https://drafts.csswg.org/css-display-4/#non-replaced" id="ref-for-non-replaced">non-replaced</a> <a data-link-type="dfn" href="https://drafts.csswg.org/css-display-4/#inline" id="ref-for-inline">inlines</a> <tr> <th><a href="https://www.w3.org/TR/css-cascade/#inherited-property">Inherited:</a> <td>no <tr> <th><a href="https://www.w3.org/TR/css-values/#percentages">Percentages:</a> <td>relative to width/height of <a data-link-type="dfn" href="https://drafts.csswg.org/css-display-4/#containing-block" id="ref-for-containing-block⑥">containing block</a> <tr> <th><a href="https://www.w3.org/TR/css-cascade/#computed">Computed value:</a> <td>as specified, with <a class="production css" data-link-type="type" href="https://drafts.csswg.org/css-values-4/#typedef-length-percentage" id="ref-for-typedef-length-percentage②">&lt;length-percentage></a> values computed <tr> <th><a href="https://www.w3.org/TR/cssom/#serializing-css-values">Canonical order:</a> <td>per grammar <tr> <th><a href="https://www.w3.org/TR/web-animations/#animation-type">Animation type:</a> <td>by computed value type, recursing into <a class="css" data-link-type="maybe" href="#funcdef-width-fit-content" id="ref-for-funcdef-width-fit-content">fit-content()</a> <tr> <th><a href="https://drafts.csswg.org/css-logical-1/#logical-property-group">Logical property group:</a> <td><a class="css" data-link-type="property">size</a> </table> <p>The <a class="property css" data-link-type="property" href="#propdef-width" id="ref-for-propdef-width⑤">width</a> and <a class="property css" data-link-type="property" href="#propdef-height" id="ref-for-propdef-height⑤">height</a> (<a data-link-type="dfn" href="https://drafts.csswg.org/css-writing-modes-4/#physical" id="ref-for-physical">physical</a>) properties specify the <dfn class="dfn-paneled" data-dfn-type="dfn" data-export data-lt="preferred size" id="preferred-size">preferred</dfn> <dfn class="dfn-paneled" data-dfn-type="dfn" data-export data-lt="width | preferred width" id="width">width</dfn> and <dfn class="dfn-paneled" data-dfn-type="dfn" data-export data-lt="height | preferred height" id="height">height</dfn> of the box, respectively.</p> <h4 class="heading settled dfn-paneled" data-dfn-type="dfn" data-export data-level="3.1.2" data-lt="min size property" id="min-size-properties"><span class="secno">3.1.2. </span><span class="content"> Minimum Size Properties: the <a class="property css" data-link-type="property" href="#propdef-min-width" id="ref-for-propdef-min-width②">min-width</a> and <a class="property css" data-link-type="property" href="#propdef-min-height" id="ref-for-propdef-min-height②">min-height</a> properties</span><a class="self-link" href="#min-size-properties" id="ref-for-min-size-properties"></a></h4> <table class="def propdef" data-link-for-hint="min-width"> <tbody> <tr> <th>Name: <td><dfn class="dfn-paneled css" data-dfn-type="property" data-export id="propdef-min-width">min-width</dfn>, <dfn class="dfn-paneled css" data-dfn-type="property" data-export id="propdef-min-height">min-height</dfn> <tr class="value"> <th><a href="https://www.w3.org/TR/css-values/#value-defs">Value:</a> <td class="prod">auto <a data-link-type="grammar" href="https://drafts.csswg.org/css-values-4/#comb-one" id="ref-for-comb-one⑤">|</a> <a class="production css" data-link-type="type" href="https://drafts.csswg.org/css-values-4/#typedef-length-percentage" id="ref-for-typedef-length-percentage③">&lt;length-percentage [0,∞]></a> <span id="ref-for-comb-one⑥">|</span> min-content <span id="ref-for-comb-one⑦">|</span> max-content <span id="ref-for-comb-one⑧">|</span> <span style=";white-space:nowrap">fit-content(<a class="production css" data-link-type="type" href="https://drafts.csswg.org/css-values-4/#typedef-length-percentage" id="ref-for-typedef-length-percentage④">&lt;length-percentage [0,∞]></a>)</span> <span id="ref-for-comb-one⑨">|</span> <a class="production css" data-link-type="function" href="#funcdef-width-calc-size" id="ref-for-funcdef-width-calc-size①">&lt;calc-size()></a> <tr> <th><a href="https://www.w3.org/TR/css-cascade/#initial-values">Initial:</a> <td>auto <tr> <th><a href="https://www.w3.org/TR/css-cascade/#applies-to">Applies to:</a> <td>all elements that accept <a class="property css" data-link-type="property" href="#propdef-width" id="ref-for-propdef-width⑥">width</a> or <a class="property css" data-link-type="property" href="#propdef-height" id="ref-for-propdef-height⑥">height</a> <tr> <th><a href="https://www.w3.org/TR/css-cascade/#inherited-property">Inherited:</a> <td>no <tr> <th><a href="https://www.w3.org/TR/css-values/#percentages">Percentages:</a> <td>relative to width/height of <a data-link-type="dfn" href="https://drafts.csswg.org/css-display-4/#containing-block" id="ref-for-containing-block⑦">containing block</a> <tr> <th><a href="https://www.w3.org/TR/css-cascade/#computed">Computed value:</a> <td>as specified, with <a class="production css" data-link-type="type" href="https://drafts.csswg.org/css-values-4/#typedef-length-percentage" id="ref-for-typedef-length-percentage⑤">&lt;length-percentage></a> values computed <tr> <th><a href="https://www.w3.org/TR/cssom/#serializing-css-values">Canonical order:</a> <td>per grammar <tr> <th><a href="https://www.w3.org/TR/web-animations/#animation-type">Animation type:</a> <td>by computed value, recursing into <a class="css" data-link-type="maybe" href="#funcdef-width-fit-content" id="ref-for-funcdef-width-fit-content①">fit-content()</a> <tr> <th><a href="https://drafts.csswg.org/css-logical-1/#logical-property-group">Logical property group:</a> <td><a class="css" data-link-type="property">min-size</a> </table> <p>The <a class="property css" data-link-type="property" href="#propdef-min-width" id="ref-for-propdef-min-width③">min-width</a> and <a class="property css" data-link-type="property" href="#propdef-min-height" id="ref-for-propdef-min-height③">min-height</a> properties specify the <dfn class="dfn-paneled" data-dfn-type="dfn" data-export data-lt="min width | minimum width | min size | minimum size" id="min-width">minimum width</dfn> (or “min width”) and <dfn class="dfn-paneled" data-dfn-type="dfn" data-export data-lt="min height | minimum height" id="min-height">minimum height</dfn> (or “min height”) of the box, respectively.</p> <p class="note" role="note"><span class="marker">Note:</span> The initial value of <a class="css" data-link-type="maybe" href="#valdef-width-auto" id="ref-for-valdef-width-auto②">auto</a> is new; in <a data-link-type="biblio" href="#biblio-css2" title="Cascading Style Sheets Level 2 Revision 1 (CSS 2.1) Specification">[CSS2]</a> the initial value was zero.</p> <h4 class="heading settled dfn-paneled" data-dfn-type="dfn" data-export data-level="3.1.3" data-lt="max size property" id="max-size-properties"><span class="secno">3.1.3. </span><span class="content"> Maximum Size Properties: the <a class="property css" data-link-type="property" href="#propdef-max-width" id="ref-for-propdef-max-width②">max-width</a> and <a class="property css" data-link-type="property" href="#propdef-max-height" id="ref-for-propdef-max-height②">max-height</a> properties</span><a class="self-link" href="#max-size-properties" id="ref-for-max-size-properties"></a></h4> <table class="def propdef" data-link-for-hint="max-width"> <tbody> <tr> <th>Name: <td><dfn class="dfn-paneled css" data-dfn-type="property" data-export id="propdef-max-width">max-width</dfn>, <dfn class="dfn-paneled css" data-dfn-type="property" data-export id="propdef-max-height">max-height</dfn> <tr class="value"> <th><a href="https://www.w3.org/TR/css-values/#value-defs">Value:</a> <td class="prod">none <a data-link-type="grammar" href="https://drafts.csswg.org/css-values-4/#comb-one" id="ref-for-comb-one①⓪">|</a> <a class="production css" data-link-type="type" href="https://drafts.csswg.org/css-values-4/#typedef-length-percentage" id="ref-for-typedef-length-percentage⑥">&lt;length-percentage [0,∞]></a> <span id="ref-for-comb-one①①">|</span> min-content <span id="ref-for-comb-one①②">|</span> max-content <span id="ref-for-comb-one①③">|</span> <span style=";white-space:nowrap">fit-content(<a class="production css" data-link-type="type" href="https://drafts.csswg.org/css-values-4/#typedef-length-percentage" id="ref-for-typedef-length-percentage⑦">&lt;length-percentage [0,∞]></a>)</span> <span id="ref-for-comb-one①④">|</span> <a class="production css" data-link-type="function" href="#funcdef-width-calc-size" id="ref-for-funcdef-width-calc-size②">&lt;calc-size()></a> <tr> <th><a href="https://www.w3.org/TR/css-cascade/#initial-values">Initial:</a> <td>none <tr> <th><a href="https://www.w3.org/TR/css-cascade/#applies-to">Applies to:</a> <td>all elements that accept <a class="property css" data-link-type="property" href="#propdef-width" id="ref-for-propdef-width⑦">width</a> or <a class="property css" data-link-type="property" href="#propdef-height" id="ref-for-propdef-height⑦">height</a> <tr> <th><a href="https://www.w3.org/TR/css-cascade/#inherited-property">Inherited:</a> <td>no <tr> <th><a href="https://www.w3.org/TR/css-values/#percentages">Percentages:</a> <td>relative to width/height of <a data-link-type="dfn" href="https://drafts.csswg.org/css-display-4/#containing-block" id="ref-for-containing-block⑧">containing block</a> <tr> <th><a href="https://www.w3.org/TR/css-cascade/#computed">Computed value:</a> <td>as specified, with <a class="production css" data-link-type="type" href="https://drafts.csswg.org/css-values-4/#typedef-length-percentage" id="ref-for-typedef-length-percentage⑧">&lt;length-percentage></a> values computed <tr> <th><a href="https://www.w3.org/TR/cssom/#serializing-css-values">Canonical order:</a> <td>per grammar <tr> <th><a href="https://www.w3.org/TR/web-animations/#animation-type">Animation type:</a> <td>by computed value, recursing into <a class="css" data-link-type="maybe" href="#funcdef-width-fit-content" id="ref-for-funcdef-width-fit-content②">fit-content()</a> <tr> <th><a href="https://drafts.csswg.org/css-logical-1/#logical-property-group">Logical property group:</a> <td><a class="css" data-link-type="property">max-size</a> </table> <p>The <a class="property css" data-link-type="property" href="#propdef-max-width" id="ref-for-propdef-max-width③">max-width</a> and <a class="property css" data-link-type="property" href="#propdef-max-height" id="ref-for-propdef-max-height③">max-height</a> properties specify the <dfn class="dfn-paneled" data-dfn-type="dfn" data-export data-lt="max width | maximum width | max size | maximum size" id="max-width">maximum width</dfn> (or “max width”) and <dfn class="dfn-paneled" data-dfn-type="dfn" data-export data-lt="max height | maximum height" id="max-height">maximum height</dfn> (or “max height”) of the box, respectively.</p> <h3 class="heading settled" data-level="3.2" id="sizing-values"><span class="secno">3.2. </span><span class="content"> Sizing Values: the <a class="production css" data-link-type="type" href="https://drafts.csswg.org/css-values-4/#typedef-length-percentage" id="ref-for-typedef-length-percentage⑨">&lt;length-percentage [0,∞]></a>, <a class="css" data-link-type="maybe" href="#valdef-width-auto" id="ref-for-valdef-width-auto③">auto</a> | <a class="css" data-link-type="maybe" href="#valdef-max-width-none" id="ref-for-valdef-max-width-none">none</a>, <a class="css" data-link-type="maybe" href="#valdef-width-min-content" id="ref-for-valdef-width-min-content">min-content</a>, <a class="css" data-link-type="maybe" href="#valdef-width-max-content" id="ref-for-valdef-width-max-content①">max-content</a>, and <a class="css" data-link-type="maybe" href="#funcdef-width-fit-content" id="ref-for-funcdef-width-fit-content③">fit-content()</a> values</span><span id="width-height-keywords"></span><a class="self-link" href="#sizing-values"></a></h3> <dl> <dt><dfn class="dfn-paneled css" data-dfn-for="width, min-width, max-width, height, min-height, max-height" data-dfn-type="value" data-export id="valdef-width-length-percentage-0"><a class="production css" data-link-type="type" href="https://drafts.csswg.org/css-values-4/#typedef-length-percentage" id="ref-for-typedef-length-percentage①⓪">&lt;length-percentage [0,∞]></a></dfn> <dd> Specifies the size of the box using <a class="production css" data-link-type="type" href="https://drafts.csswg.org/css-values-4/#length-value" id="ref-for-length-value①">&lt;length></a> and/or <a class="production css" data-link-type="type" href="https://drafts.csswg.org/css-values-4/#percentage-value" id="ref-for-percentage-value①">&lt;percentage></a>. The <a class="property css" data-link-type="property" href="#propdef-box-sizing" id="ref-for-propdef-box-sizing①">box-sizing</a> property indicates whether the <a data-link-type="dfn" href="https://drafts.csswg.org/css-box-4/#content-box" id="ref-for-content-box①">content box</a> or <a data-link-type="dfn" href="https://drafts.csswg.org/css-box-4/#border-box" id="ref-for-border-box">border box</a> is measured. <p>Percentages are resolved against the width/height, as appropriate, of the box’s <a data-link-type="dfn" href="https://drafts.csswg.org/css-display-4/#containing-block" id="ref-for-containing-block⑨">containing block</a>. If, in a particular axis, the <span id="ref-for-containing-block①⓪">containing block’s</span> size depends on the box’s size, see the relevant layout module for special rules on how to resolve percentages.</p> <p>Negative values are invalid.</p> <dt><dfn class="dfn-paneled css" data-dfn-for="width, height, min-width, min-height" data-dfn-type="value" data-export id="valdef-width-auto">auto</dfn> <dd> For <a class="property css" data-link-type="property" href="#propdef-width" id="ref-for-propdef-width⑧">width</a>/<a class="property css" data-link-type="property" href="#propdef-height" id="ref-for-propdef-height⑧">height</a>, specifies an <dfn class="dfn-paneled" data-dfn-for data-dfn-type="dfn" data-export id="automatic-size">automatic size</dfn> (<dfn class="dfn-paneled" data-dfn-for data-dfn-type="dfn" data-export id="automatic-block-size">automatic <a data-link-type="dfn" href="https://drafts.csswg.org/css-writing-modes-4/#block-size" id="ref-for-block-size③">block size</a></dfn>/<dfn class="dfn-paneled" data-dfn-for data-dfn-type="dfn" data-export id="automatic-inline-size">automatic <a data-link-type="dfn" href="https://drafts.csswg.org/css-writing-modes-4/#inline-size" id="ref-for-inline-size④">inline size</a></dfn>). See the relevant layout module for how to calculate this. <p>For <a class="property css" data-link-type="property" href="#propdef-min-width" id="ref-for-propdef-min-width④">min-width</a>/<a class="property css" data-link-type="property" href="#propdef-min-height" id="ref-for-propdef-min-height④">min-height</a>, specifies an <dfn class="dfn-paneled" data-dfn-for data-dfn-type="dfn" data-export id="automatic-minimum-size">automatic minimum size</dfn>. Unless otherwise defined by the relevant layout module, however, it resolves to a used value of <span class="css">0</span>. For backwards-compatibility, the <a data-link-type="dfn" href="https://drafts.csswg.org/cssom-1/#resolved-value" id="ref-for-resolved-value">resolved value</a> of this keyword is zero for boxes of all <a data-link-type="biblio" href="#biblio-css2" title="Cascading Style Sheets Level 2 Revision 1 (CSS 2.1) Specification">[CSS2]</a> <a data-link-type="dfn" href="https://drafts.csswg.org/css-display-4/#display-type" id="ref-for-display-type">display types</a>: block and inline boxes, inline blocks, and all the table layout boxes. It also resolves to zero when no box is generated.</p> <dt><dfn class="dfn-paneled css" data-dfn-for="max-width, max-height" data-dfn-type="value" data-export id="valdef-max-width-none">none</dfn> <dd> No limit on the size of the box. <dt><dfn class="dfn-paneled css" data-dfn-for="width, min-width, max-width, height, min-height, max-height" data-dfn-type="value" data-export id="valdef-width-min-content">min-content</dfn> <dd> Use the <a data-link-type="dfn" href="#min-content" id="ref-for-min-content⑦">min-content size</a> in the relevant axis; for a box’s <a data-link-type="dfn" href="https://drafts.csswg.org/css-writing-modes-4/#block-size" id="ref-for-block-size④">block size</a>, unless otherwise specified, this is equivalent to its <a data-link-type="dfn" href="#automatic-size" id="ref-for-automatic-size">automatic size</a>. <dt><dfn class="dfn-paneled css" data-dfn-for="width, min-width, max-width, height, min-height, max-height" data-dfn-type="value" data-export id="valdef-width-max-content">max-content</dfn> <dd> Use the <a data-link-type="dfn" href="#max-content" id="ref-for-max-content⑤">max-content size</a> in the relevant axis; for a box’s <a data-link-type="dfn" href="https://drafts.csswg.org/css-writing-modes-4/#block-size" id="ref-for-block-size⑤">block size</a>, unless otherwise specified, this is equivalent to its <a data-link-type="dfn" href="#automatic-size" id="ref-for-automatic-size①">automatic size</a>. <dt><dfn class="dfn-paneled css" data-dfn-for="width, min-width, max-width, height, min-height, max-height" data-dfn-type="function" data-export data-lt="fit-content()" id="funcdef-width-fit-content">fit-content(<a class="production css" data-link-type="type" href="https://drafts.csswg.org/css-values-4/#typedef-length-percentage" id="ref-for-typedef-length-percentage①①">&lt;length-percentage [0,∞]></a>)</dfn> <dd> Use the fit-content formula with the <a data-link-type="dfn" href="#available" id="ref-for-available⑦">available space</a> replaced by the specified argument, i.e. <code>min(<a class="css" data-link-type="maybe" href="#valdef-width-max-content" id="ref-for-valdef-width-max-content②">max-content</a>, max(<a class="css" data-link-type="maybe" href="#valdef-width-min-content" id="ref-for-valdef-width-min-content①">min-content</a>, <a class="production css" data-link-type="type" href="https://drafts.csswg.org/css-values-4/#typedef-length-percentage" id="ref-for-typedef-length-percentage①②">&lt;length-percentage></a>))</code>, where the <a class="production css" data-link-type="type" href="https://drafts.csswg.org/css-values-4/#typedef-length-percentage" id="ref-for-typedef-length-percentage①③">&lt;length-percentage></a> argument is resolved exactly as for <span class="production" id="ref-for-typedef-length-percentage①④">&lt;length-percentage></span> values standing alone. <p>Negative <a class="production css" data-link-type="type" href="https://drafts.csswg.org/css-values-4/#typedef-length-percentage" id="ref-for-typedef-length-percentage①⑤">&lt;length-percentage></a> values are invalid.</p> <dt><dfn class="dfn-paneled css" data-dfn-for="width, min-width, max-width, height, min-height, max-height" data-dfn-type="function" data-export id="funcdef-width-calc-size">calc-size()</dfn> <dd> See <a class="production css" data-link-type="function" href="#funcdef-width-calc-size" id="ref-for-funcdef-width-calc-size③">&lt;calc-size()></a>. <p class="note" role="note"><span class="marker">Note:</span> The <a class="css" data-link-type="maybe" href="#valdef-max-width-none" id="ref-for-valdef-max-width-none①">none</a> keyword is not usable within <a class="css" data-link-type="maybe" href="#funcdef-width-calc-size" id="ref-for-funcdef-width-calc-size④">calc-size()</a>.</p> </dl> <p>In all cases, the used value is floored to preserve a non-negative <a data-link-type="dfn" href="#inner-size" id="ref-for-inner-size">inner size</a>.</p> <p class="note" role="note"><span class="marker">Note:</span> The <a class="css" data-link-type="maybe" href="#valdef-width-min-content" id="ref-for-valdef-width-min-content②">min-content</a>, <a class="css" data-link-type="maybe" href="#valdef-width-max-content" id="ref-for-valdef-width-max-content③">max-content</a>, and <a class="css" data-link-type="maybe" href="#funcdef-width-fit-content" id="ref-for-funcdef-width-fit-content④">fit-content()</a> values are new in Level 3.</p> <p class="note" role="note"><span class="marker">Note:</span> The <a class="property css" data-link-type="property" href="https://drafts.csswg.org/css-flexbox-1/#propdef-flex-basis" id="ref-for-propdef-flex-basis">flex-basis</a> property hereby also gains these new keywords, as its values are defined by reference to &lt;<a class="property css" data-link-type="property" href="#propdef-width" id="ref-for-propdef-width⑨">width</a>>.</p> <p class="note" role="note"><span class="marker">Note:</span> This section previously defined <a class="css" data-link-type="maybe" href="https://drafts.csswg.org/css-sizing-4/#valdef-width-stretch" id="ref-for-valdef-width-stretch">stretch</a> and <a class="css" data-link-type="maybe" href="https://drafts.csswg.org/css-sizing-4/#valdef-width-fit-content" id="ref-for-valdef-width-fit-content">fit-content</a> as keywords representing the <a data-link-type="dfn" href="#stretch-fit-size" id="ref-for-stretch-fit-size②">stretch-fit size</a> and <a data-link-type="dfn" href="#fit-content-size" id="ref-for-fit-content-size">fit-content size</a>, respectively. These keywords have been deferred to Level 4 (along with an additional <a class="css" data-link-type="maybe" href="https://drafts.csswg.org/css-sizing-4/#valdef-width-contain" id="ref-for-valdef-width-contain">contain</a> keyword that behaves similarly to <span class="css" id="ref-for-valdef-width-stretch①">stretch</span> but preserves the <a data-link-type="dfn" href="#preferred-aspect-ratio" id="ref-for-preferred-aspect-ratio②">preferred aspect ratio</a>, if any) to better work out the implications in situations with <a data-link-type="dfn" href="#indefinite" id="ref-for-indefinite④">indefinite</a> <a data-link-type="dfn" href="#available" id="ref-for-available⑧">available space</a>.</p> <h4 class="heading settled" data-level="3.2.1" id="behave-auto"><span class="secno">3.2.1. </span><span class="content"> “Behaving as <a class="css" data-link-type="maybe" href="#valdef-width-auto" id="ref-for-valdef-width-auto④">auto</a>”</span><a class="self-link" href="#behave-auto"></a></h4> <p>To have a common term for both when <a class="property css" data-link-type="property" href="#propdef-width" id="ref-for-propdef-width①⓪">width</a>/<a class="property css" data-link-type="property" href="#propdef-height" id="ref-for-propdef-height⑨">height</a> computes to <a class="css" data-link-type="maybe" href="#valdef-width-auto" id="ref-for-valdef-width-auto⑤">auto</a> and when it is defined to behave as if <span class="css" id="ref-for-valdef-width-auto⑥">auto</span> were specified (as in the case of <a href="https://www.w3.org/TR/CSS2/visudet.html#the-height-property">block percentage heights</a> resolving against an <a data-link-type="dfn" href="#indefinite" id="ref-for-indefinite⑤">indefinite</a> size, see <a href="https://www.w3.org/TR/CSS2/visudet.html#the-height-property">CSS2§10.5</a>), the property is said to <dfn class="dfn-paneled" data-dfn-type="dfn" data-export data-lt="behave as auto|behaves as auto|behaving as auto" id="behave-as-auto">behave as auto</dfn> in both of these cases.</p> <p class="note" role="note"><span class="marker">Note:</span> Legacy spec prose defining layout behavior, particularly in <a data-link-type="biblio" href="#biblio-css2" title="Cascading Style Sheets Level 2 Revision 1 (CSS 2.1) Specification">[CSS2]</a>, might explicitly refer to <a class="property css" data-link-type="property" href="#propdef-width" id="ref-for-propdef-width①①">width</a>/<a class="property css" data-link-type="property" href="#propdef-height" id="ref-for-propdef-height①⓪">height</a> having a computed value of <a class="css" data-link-type="maybe" href="#valdef-width-auto" id="ref-for-valdef-width-auto⑦">auto</a> as a condition; some of these cases should be interpreted as meaning <a data-link-type="dfn" href="#behave-as-auto" id="ref-for-behave-as-auto">behaves as auto</a>, and reported to the CSSWG for updating.</p> <p class="issue" id="issue-6215c343"><a class="self-link" href="#issue-6215c343"></a> Replace this section with references to the new term <a data-link-type="dfn" href="#automatic-size" id="ref-for-automatic-size②">automatic size</a>.</p> <h4 class="heading settled" data-level="3.2.2" id="the-contain-floats-value"><span class="secno">3.2.2. </span><span class="content"> Containing or Excluding Floats</span><a class="self-link" href="#the-contain-floats-value"></a></h4> <p><em>This section is non-normative.</em></p> <p>Although <a data-link-type="dfn" href="https://drafts.csswg.org/css-display-4/#block-box" id="ref-for-block-box">block box</a> boundaries are typically pervious to floats, sometimes an author needs them to contain their own (descendant) floats or to exclude floats from outside. For Block layout, specifying <a class="css" data-link-type="propdesc" href="https://drafts.csswg.org/css-display-3/#propdef-display" id="ref-for-propdef-display">display: flow-root</a> will make the box a <a data-link-type="dfn" href="https://drafts.csswg.org/css-display-4/#formatting-context" id="ref-for-formatting-context">formatting context</a> root, which has this behavior.</p> <p class="note" role="note"><span class="marker">Note:</span> Boxes participating in Flex, Grid, or Table layout will automatically have this behavior.</p> <h3 class="heading settled caniuse-paneled" data-level="3.3" id="box-sizing"><span class="secno">3.3. </span><span class="content"> Box Edges for Sizing: the <a class="property css" data-link-type="property" href="#propdef-box-sizing" id="ref-for-propdef-box-sizing②">box-sizing</a> property</span><a class="self-link" href="#box-sizing"></a></h3> <table class="def propdef" data-link-for-hint="box-sizing"> <tbody> <tr> <th>Name: <td><dfn class="dfn-paneled css" data-dfn-type="property" data-export id="propdef-box-sizing">box-sizing</dfn> <tr class="value"> <th><a href="https://www.w3.org/TR/css-values/#value-defs">Value:</a> <td class="prod">content-box <a data-link-type="grammar" href="https://drafts.csswg.org/css-values-4/#comb-one" id="ref-for-comb-one①⑤">|</a> border-box <tr> <th><a href="https://www.w3.org/TR/css-cascade/#initial-values">Initial:</a> <td>content-box <tr> <th><a href="https://www.w3.org/TR/css-cascade/#applies-to">Applies to:</a> <td>all elements that accept <a class="property css" data-link-type="property" href="#propdef-width" id="ref-for-propdef-width①②">width</a> or <a class="property css" data-link-type="property" href="#propdef-height" id="ref-for-propdef-height①①">height</a> <tr> <th><a href="https://www.w3.org/TR/css-cascade/#inherited-property">Inherited:</a> <td>no <tr> <th><a href="https://www.w3.org/TR/css-values/#percentages">Percentages:</a> <td>N/A <tr> <th><a href="https://www.w3.org/TR/css-cascade/#computed">Computed value:</a> <td>specified keyword <tr> <th><a href="https://www.w3.org/TR/cssom/#serializing-css-values">Canonical order:</a> <td>per grammar <tr> <th><a href="https://www.w3.org/TR/web-animations/#animation-type">Animation type:</a> <td>discrete </table> <p>The <a class="property css" data-link-type="property" href="#propdef-box-sizing" id="ref-for-propdef-box-sizing③">box-sizing</a> property defines whether fixed sizes (such as <a class="production css" data-link-type="type" href="https://drafts.csswg.org/css-values-4/#length-value" id="ref-for-length-value②">&lt;length></a>s and <a class="production css" data-link-type="type" href="https://drafts.csswg.org/css-values-4/#percentage-value" id="ref-for-percentage-value②">&lt;percentage></a>s) are assigned to the <a data-link-type="dfn" href="https://drafts.csswg.org/css-box-4/#content-box" id="ref-for-content-box②">content box</a> or to the <a data-link-type="dfn" href="https://drafts.csswg.org/css-box-4/#border-box" id="ref-for-border-box①">border box</a>. It affects the interpretation of all <a data-link-type="dfn" href="#sizing-property" id="ref-for-sizing-property">sizing properties</a>, including <a class="property css" data-link-type="property" href="https://drafts.csswg.org/css-flexbox-1/#propdef-flex-basis" id="ref-for-propdef-flex-basis①">flex-basis</a>.</p> <p>Values have the following meanings:</p> <dl> <dt><dfn class="dfn-paneled css" data-dfn-for="box-sizing" data-dfn-type="value" data-export id="valdef-box-sizing-content-box">content-box</dfn> <dd> Sizes specified on <a data-link-type="dfn" href="#sizing-property" id="ref-for-sizing-property①">sizing properties</a> as <a class="production css" data-link-type="type" href="https://drafts.csswg.org/css-values-4/#typedef-length-percentage" id="ref-for-typedef-length-percentage①⑥">&lt;length-percentage></a> represent the box’s <a data-link-type="dfn" href="#inner-size" id="ref-for-inner-size①">inner sizes</a>, excluding the margins/border/padding: they are applied to the <a data-link-type="dfn" href="https://drafts.csswg.org/css-box-4/#content-box" id="ref-for-content-box③">content box</a>. The padding and border of the box are laid out and drawn <em>outside</em> the specified <a class="property css" data-link-type="property" href="#propdef-width" id="ref-for-propdef-width①③">width</a> and <a class="property css" data-link-type="property" href="#propdef-height" id="ref-for-propdef-height①②">height</a>. <p class="note" role="note"><span class="marker">Note:</span> This is the behavior of width and height as specified by CSS2.1, and is thus the default.</p> <dt><dfn class="dfn-paneled css" data-dfn-for="box-sizing" data-dfn-type="value" data-export id="valdef-box-sizing-border-box">border-box</dfn> <dd> Sizes specified on <a data-link-type="dfn" href="#sizing-property" id="ref-for-sizing-property②">sizing properties</a> as <a class="production css" data-link-type="type" href="https://drafts.csswg.org/css-values-4/#typedef-length-percentage" id="ref-for-typedef-length-percentage①⑦">&lt;length-percentage></a> represent the box’s visually-apparent sizes, including the borders/padding (but not margin): they are applied to the <a data-link-type="dfn" href="https://drafts.csswg.org/css-box-4/#border-box" id="ref-for-border-box②">border box</a>. The padding and border of the box are laid out and drawn <em>inside</em> the specified <a class="property css" data-link-type="property" href="#propdef-width" id="ref-for-propdef-width①④">width</a> and <a class="property css" data-link-type="property" href="#propdef-height" id="ref-for-propdef-height①③">height</a>, with the <a data-link-type="dfn" href="https://drafts.csswg.org/css-box-4/#content-box" id="ref-for-content-box④">content box</a> sized to fill the remaining space, floored at zero. <p>The content width and height are calculated by subtracting the border and padding widths of the respective sides from the specified <a class="production css" data-link-type="type" href="https://drafts.csswg.org/css-values-4/#typedef-length-percentage" id="ref-for-typedef-length-percentage①⑧">&lt;length-percentage></a>. As the content width and height <a href="#sizing-values">cannot be negative</a>, this computation is floored at zero.</p> <p>Used values, as exposed for instance through <code class="idl"><a data-link-type="idl" href="https://drafts.csswg.org/cssom-1/#dom-window-getcomputedstyle" id="ref-for-dom-window-getcomputedstyle">getComputedStyle()</a></code>, also refer to the border box.</p> </dl> <p>Values affected by <a class="property css" data-link-type="property" href="#propdef-box-sizing" id="ref-for-propdef-box-sizing④">box-sizing</a> include both raw <a class="production css" data-link-type="type" href="https://drafts.csswg.org/css-values-4/#typedef-length-percentage" id="ref-for-typedef-length-percentage①⑨">&lt;length-percentage></a> values and those used in functional notations such as <a class="css" data-link-type="maybe" href="#funcdef-width-fit-content" id="ref-for-funcdef-width-fit-content⑤">fit-content()</a>. In contrast, non-quantitative values such as <a class="css" data-link-type="maybe" href="#valdef-width-auto" id="ref-for-valdef-width-auto⑧">auto</a> and <a class="css" data-link-type="maybe" href="#valdef-width-min-content" id="ref-for-valdef-width-min-content③">min-content</a> are not influenced by the <span class="property" id="ref-for-propdef-box-sizing⑤">box-sizing</span> property (unless otherwise specified).</p> <div class="example" id="example-8af7a68e"> <a class="self-link" href="#example-8af7a68e"></a> For example, the following properties set the content-box size of the box to <span class="css">100px</span>, with the border-box size calculating to <span class="css">120px</span>: <pre class="lang-css highlight">.box <c- p>{</c-> <c- k>box-sizing</c-><c- p>:</c-> content-box<c- p>;</c-> <c- c>/* default */</c-> width: <c- m>100</c-><c- k>px</c-><c- p>;</c-> <c- k>padding-left</c-><c- p>:</c-> <c- m>10</c-><c- k>px</c-><c- p>;</c-> <c- k>border-left</c-><c- p>:</c-> <c- m>10</c-><c- k>px</c-> solid<c- p>;</c-> <c- p>}</c-> </pre> <p>On the other hand, by changing to <a class="css" data-link-type="maybe" href="#valdef-box-sizing-border-box" id="ref-for-valdef-box-sizing-border-box">border-box</a>, the border-box is set to <span class="css">100px</span>, with the content-box size calculating to <span class="css">80px</span>:</p> <pre class="lang-css highlight">.box <c- p>{</c-> <c- k>box-sizing</c-><c- p>:</c-> border-box<c- p>;</c-> <c- k>width</c-><c- p>:</c-> <c- m>100</c-><c- k>px</c-><c- p>;</c-> <c- k>padding-left</c-><c- p>:</c-> <c- m>10</c-><c- k>px</c-><c- p>;</c-> <c- k>border-left</c-><c- p>:</c-> <c- m>10</c-><c- k>px</c-> solid<c- p>;</c-> <c- p>}</c-> </pre> <p>The <a data-link-type="dfn" href="#inner-size" id="ref-for-inner-size②">inner size</a> can’t be less than zero, so if the <a class="property css" data-link-type="property" href="https://drafts.csswg.org/css-box-4/#propdef-padding" id="ref-for-propdef-padding">padding</a> + <a class="property css" data-link-type="property" href="https://drafts.csswg.org/css-backgrounds-3/#propdef-border" id="ref-for-propdef-border">border</a> is greater than the specified border-box size, the box will end up larger than specified. In this case, the content-box size will floor at <span class="css">0px</span> so the border-box size ends up at <span class="css">120px</span>, even though <a class="css" data-link-type="propdesc" href="#propdef-width" id="ref-for-propdef-width①⑤">width: 100px</a> is specified for the border box:</p> <pre class="lang-css highlight">.box <c- p>{</c-> <c- k>box-sizing</c-><c- p>:</c-> border-box<c- p>;</c-> <c- k>width</c-><c- p>:</c-> <c- m>100</c-><c- k>px</c-><c- p>;</c-> <c- k>padding-left</c-><c- p>:</c-> <c- m>60</c-><c- k>px</c-><c- p>;</c-> <c- k>border-left</c-><c- p>:</c-> <c- m>60</c-><c- k>px</c-> solid<c- p>;</c-> <c- c>/* padding + border = 120px */</c-> <c- p>}</c-> </pre> </div> <div class="example" id="example-0700ac27"> <a class="self-link" href="#example-0700ac27"></a> This example uses box-sizing to evenly horizontally split two divs with fixed size borders inside a div container, which would otherwise require additional markup. <p>sample CSS:</p> <pre><code class="lang-css highlight">div.container <c- p>{</c-> <c- k>width</c-><c- p>:</c-><c- m>38</c-><c- k>em</c-><c- p>;</c-> <c- k>border</c-><c- p>:</c-><c- m>1</c-><c- k>em</c-> solid black<c- p>;</c-> <c- p>}</c-> div.split <c- p>{</c-> <c- k>box-sizing</c-><c- p>:</c->border-box<c- p>;</c-> <c- k>width</c-><c- p>:</c-><c- m>50</c-><c- k>%</c-><c- p>;</c-> <c- k>border</c-><c- p>:</c-><c- m>1</c-><c- k>em</c-> silver ridge<c- p>;</c-> <c- k>float</c-><c- p>:</c->left<c- p>;</c-> <c- p>}</c-> </code></pre> <p>sample HTML fragment:</p> <pre><code class="lang-markup highlight"><c- p>&lt;</c-><c- f>div</c-> <c- e>class</c-><c- o>=</c-><c- s>"container"</c-><c- p>></c-> <c- p>&lt;</c-><c- f>div</c-> <c- e>class</c-><c- o>=</c-><c- s>"split"</c-><c- p>></c->This div occupies the left half.<c- p>&lt;/</c-><c- f>div</c-><c- p>></c-> <c- p>&lt;</c-><c- f>div</c-> <c- e>class</c-><c- o>=</c-><c- s>"split"</c-><c- p>></c->This div occupies the right half.<c- p>&lt;/</c-><c- f>div</c-><c- p>></c-> <c- p>&lt;/</c-><c- f>div</c-><c- p>></c-> </code></pre> <p>demonstration of sample CSS and HTML:</p> <div style="max-width:38em; border:1em solid black"> <div style="box-sizing:border-box; width:50%; border:1em silver ridge; float:left">This div should occupy the left half.</div> <div style="box-sizing:border-box; width:50%; border:1em silver ridge; float:left">This div should occupy the right half.</div> The two divs above should appear side by side, each (including borders) 50% of the content width of their container. If instead they are stacked one on top of the other then your browser does not support <a class="property css" data-link-type="property" href="#propdef-box-sizing" id="ref-for-propdef-box-sizing⑥">box-sizing</a>. </div> </div> <p class="note" role="note"><span class="marker">Note:</span> Certain HTML elements, such as <code><a data-link-type="element" href="https://html.spec.whatwg.org/multipage/form-elements.html#the-button-element" id="ref-for-the-button-element">button</a></code>, default to <a class="css" data-link-type="maybe" href="#valdef-box-sizing-border-box" id="ref-for-valdef-box-sizing-border-box①">border-box</a> behavior. See HTML for details on which elements have this behavior.</p> <p>In legacy CSS specifications, the terms <a data-link-type="dfn" href="#width" id="ref-for-width②">width</a>, <a data-link-type="dfn" href="#height" id="ref-for-height②">height</a>, <a data-link-type="dfn" href="#min-width" id="ref-for-min-width">minimum (min) width</a>, <a data-link-type="dfn" href="#min-height" id="ref-for-min-height">minimum (min) height</a>, <a data-link-type="dfn" href="#max-width" id="ref-for-max-width">maximum (max) width</a>, and <a data-link-type="dfn" href="#max-height" id="ref-for-max-height">maximum (max) height</a> generally refer to the <a data-link-type="dfn" href="#inner-size" id="ref-for-inner-size③">inner</a> size (<a data-link-type="dfn" href="https://drafts.csswg.org/css-box-4/#content-box" id="ref-for-content-box⑤">content-box</a> size) of a <a data-link-type="dfn" href="https://drafts.csswg.org/css-display-3/#box" id="ref-for-box②">box</a> unless otherwise indicated.</p> <p>Refer to <a href="https://drafts.csswg.org/css-ui-3/#box-sizing"><cite>CSS User Interface 3</cite> § 4.1 Changing the Box Model: the box-sizing property</a> for an explicit disambiguation of these terms for the <a href="https://www.w3.org/TR/CSS21/visudet.html">Visual formatting model details</a> section of <a data-link-type="biblio" href="#biblio-css2" title="Cascading Style Sheets Level 2 Revision 1 (CSS 2.1) Specification">[CSS2]</a>.</p> <div class="advisement">To avoid ambiguities, specification authors should avoid ambiguous uses of terms such as width or height without further qualification, and should explicitly refer and link to the <a data-link-type="dfn" href="#inner-size" id="ref-for-inner-size④">inner</a> size, the <a data-link-type="dfn" href="#outer-size" id="ref-for-outer-size②">outer</a> size, the size of the <a href="https://www.w3.org/TR/css2/box.html#box-dimensions">border-box</a>, the <a data-link-type="dfn" href="https://drafts.csswg.org/css-cascade-5/#computed-value" id="ref-for-computed-value">computed value</a> of the <a data-link-type="dfn" href="#sizing-property" id="ref-for-sizing-property③">sizing properties</a>, etc, as appropriate for each case. </div> <h3 class="heading settled" data-level="3.4" id="column-sizing"><span class="secno">3.4. </span><span class="content"> New Column Sizing Values: the <a class="css" data-link-type="maybe" href="#valdef-column-width-min-content" id="ref-for-valdef-column-width-min-content">min-content</a>, <a class="css" data-link-type="maybe" href="#valdef-column-width-max-content" id="ref-for-valdef-column-width-max-content">max-content</a>, and <a class="css" data-link-type="maybe" href="#valdef-column-width-fit-content-length-percentage" id="ref-for-valdef-column-width-fit-content-length-percentage">fit-content()</a> values</span><a class="self-link" href="#column-sizing"></a></h3> <table class="def propdef partial" data-link-for-hint="column-width"> <tbody> <tr> <th>Name: <td><a class="css" data-link-type="property" href="https://drafts.csswg.org/css-multicol-2/#propdef-column-width" id="ref-for-propdef-column-width②">column-width</a> <tr class="value"> <th><a href="https://www.w3.org/TR/css-values/#value-defs">New values:</a> <td class="prod">min-content <a data-link-type="grammar" href="https://drafts.csswg.org/css-values-4/#comb-one" id="ref-for-comb-one①⑥">|</a> max-content <span id="ref-for-comb-one①⑦">|</span> fit-content(<a class="production css" data-link-type="type" href="https://drafts.csswg.org/css-values-4/#typedef-length-percentage" id="ref-for-typedef-length-percentage②⓪">&lt;length-percentage></a>) <tr> <th><a href="https://www.w3.org/TR/css-cascade/#computed">Computed value:</a> <td>as specified, with <a class="production css" data-link-type="type" href="https://drafts.csswg.org/css-values-4/#typedef-length-percentage" id="ref-for-typedef-length-percentage②①">&lt;length-percentage></a> values computed <tr> <th><a href="https://www.w3.org/TR/web-animations/#animation-type">Animation type:</a> <td>by computed value type </table> <p>When used as values for <a class="property css" data-link-type="property" href="https://drafts.csswg.org/css-multicol-2/#propdef-column-width" id="ref-for-propdef-column-width③">column-width</a>, the new keywords specify the optimal column width: </p> <dl> <dt><dfn class="dfn-paneled css" data-dfn-for="column-width" data-dfn-type="value" data-export id="valdef-column-width-min-content">min-content</dfn> <dd>Specifies the optimal column width as the <a data-link-type="dfn" href="#min-content-inline-size" id="ref-for-min-content-inline-size">min-content inline size</a> of the multi-column container’s contents. <dt><dfn class="dfn-paneled css" data-dfn-for="column-width" data-dfn-type="value" data-export id="valdef-column-width-max-content">max-content</dfn> <dd>Specifies the optimal column width as the <a data-link-type="dfn" href="#max-content-inline-size" id="ref-for-max-content-inline-size">max-content inline size</a> of the multi-column container’s contents. <dt><dfn class="dfn-paneled css" data-dfn-for="column-width" data-dfn-type="value" data-export id="valdef-column-width-fit-content-length-percentage">fit-content(<a class="production css" data-link-type="type" href="https://drafts.csswg.org/css-values-4/#typedef-length-percentage" id="ref-for-typedef-length-percentage②②">&lt;length-percentage></a>)</dfn> <dd> Specifies the optimal column width as <code>min(<a data-link-type="dfn" href="#max-content" id="ref-for-max-content⑥">max-content size</a>, max(<a data-link-type="dfn" href="#min-content" id="ref-for-min-content⑧">min-content size</a>, <a class="production css" data-link-type="type" href="https://drafts.csswg.org/css-values-4/#typedef-length-percentage" id="ref-for-typedef-length-percentage②③">&lt;length-percentage></a>))</code> </dl> <p class="note" role="note"><span class="marker">Note:</span> The column width never varies by column. When the column width is informed by the multi-column container’s contents (as in the keywords above), all of its contents are taken under consideration and the calculated width is shared by all the columns.</p> <h2 class="heading settled" data-level="4" id="extrinsic"><span class="secno">4. </span><span class="content"> Extrinsic Size Determination</span><a class="self-link" href="#extrinsic"></a></h2> <p> <dfn class="dfn-paneled" data-dfn-type="dfn" data-export id="extrinsic-sizing">Extrinsic sizing</dfn> determines sizes based on the context of an element, without regard for its contents. </p> <h3 class="heading settled" data-level="4.1" id="percentage-sizing"><span class="secno">4.1. </span><span class="content"> Percentage Sizing</span><a class="self-link" href="#percentage-sizing"></a></h3> <p>Percentages specify sizing of a box with respect to the box’s <a data-link-type="dfn" href="https://drafts.csswg.org/css-display-4/#containing-block" id="ref-for-containing-block①①">containing block</a>.</p> <div class="example" id="example-65abfbed"> <a class="self-link" href="#example-65abfbed"></a> For example, in the following markup: <pre class="lang-html highlight"><c- p>&lt;</c-><c- f>article</c-> <c- e>style</c-><c- o>=</c-><c- s>"height: 60em"</c-><c- p>></c-> <c- p>&lt;</c-><c- f>figure</c-> <c- e>style</c-><c- o>=</c-><c- s>"height: 50%;"</c-><c- p>></c-> <c- p>&lt;</c-><c- f>img</c-> <c- e>style</c-><c- o>=</c-><c- s>"height: 50%;"</c-><c- p>></c-> <c- p>&lt;/</c-><c- f>figure</c-><c- p>></c-> <c- p>&lt;/</c-><c- f>article</c-><c- p>></c-> </pre> <ul> <li data-md> <p>the <code>&lt;figure></code> would be <span class="css">30em</span> tall = 50% of the <a data-link-type="dfn" href="#definite" id="ref-for-definite⑥">definite</a> <span class="css">60em</span> height of the <code>&lt;article></code></p> <li data-md> <p>the <code>&lt;img></code> would be <span class="css">15em</span> tall = 50% of the <code>&lt;figure></code>’s height (which is itself <a data-link-type="dfn" href="#definite" id="ref-for-definite⑦">definite</a> because it’s a percentage resolved against a <span id="ref-for-definite⑧">definite</span> length)</p> </ul> </div> <p>See <a href="#cyclic-percentage-contribution">§ 5.2.1 Intrinsic Contributions of Percentage-Sized Boxes</a> for details on how to resolve percentages when the size of the <a data-link-type="dfn" href="https://drafts.csswg.org/css-display-4/#containing-block" id="ref-for-containing-block①②">containing block</a> depends on the size of its content.</p> <h2 class="heading settled" data-level="5" id="intrinsic"><span class="secno">5. </span><span class="content"> Intrinsic Size Determination</span><a class="self-link" href="#intrinsic"></a></h2> <p> <dfn class="dfn-paneled" data-dfn-type="dfn" data-export id="intrinsic-sizing">Intrinsic sizing</dfn> determines sizes based on the contents of an element, without regard for its context. </p> <h3 class="heading settled" data-level="5.1" id="intrinsic-sizes"><span class="secno">5.1. </span><span class="content"> Intrinsic Sizes</span><a class="self-link" href="#intrinsic-sizes"></a></h3> <p>The <a data-link-type="dfn" href="#min-content" id="ref-for-min-content⑨">min-content size</a> of a box in each axis is the size it would have if it was a float given an <a class="css" data-link-type="maybe" href="#valdef-width-auto" id="ref-for-valdef-width-auto⑨">auto</a> <a data-link-type="dfn" href="#preferred-size" id="ref-for-preferred-size">preferred size</a> in that axis (and no <a data-link-type="dfn" href="#min-width" id="ref-for-min-width①">minimum</a> or <a data-link-type="dfn" href="#max-width" id="ref-for-max-width①">maximum size</a> in that axis) and if its containing block was <em>zero</em>-sized in that axis. (In other words, the minimum size it has when sized as “shrink-to-fit”.)</p> <p>The <a data-link-type="dfn" href="#max-content" id="ref-for-max-content⑦">max-content size</a> of a box in each axis is the size it would have if it was a float given an <a class="css" data-link-type="maybe" href="#valdef-width-auto" id="ref-for-valdef-width-auto①⓪">auto</a> <a data-link-type="dfn" href="#preferred-size" id="ref-for-preferred-size①">preferred size</a> in that axis (and no <a data-link-type="dfn" href="#min-width" id="ref-for-min-width②">minimum</a> or <a data-link-type="dfn" href="#max-width" id="ref-for-max-width②">maximum size</a> in that axis), and if its containing block was <em>infinitely</em>-sized in that axis. (In other words, the maximum size it has when sized as “shrink-to-fit”.)</p> <p>The <a data-link-type="dfn" href="#min-content" id="ref-for-min-content①⓪">min-content size</a> and <a data-link-type="dfn" href="#max-content" id="ref-for-max-content⑧">max-content size</a> are collectively referred to as the <a data-link-type="dfn" href="#intrinsic-size" id="ref-for-intrinsic-size①">intrinsic sizes</a>.</p> <p class="note" role="note"><span class="marker">Note:</span> When the box has a <a data-link-type="dfn" href="#preferred-aspect-ratio" id="ref-for-preferred-aspect-ratio③">preferred aspect ratio</a>, size constraints in the opposite dimension will transfer through and can affect the <a class="css" data-link-type="maybe" href="#valdef-width-auto" id="ref-for-valdef-width-auto①①">auto</a> size in the considered one. See <a href="https://www.w3.org/TR/CSS2/visudet.html">CSS2§10</a>.</p> <p>This specification does not define how to determine the sizes of floats. Please refer to <a data-link-type="biblio" href="#biblio-css2" title="Cascading Style Sheets Level 2 Revision 1 (CSS 2.1) Specification">[CSS2]</a>. However, the <a data-link-type="dfn" href="#intrinsic-size" id="ref-for-intrinsic-size②">intrinsic sizes</a> of <a data-link-type="dfn" href="https://drafts.csswg.org/css-display-4/#replaced-element" id="ref-for-replaced-element①">replaced elements</a> without <a data-link-type="dfn" href="https://drafts.csswg.org/css-images-3/#natural-size" id="ref-for-natural-size">natural sizes</a> are defined below:</p> <dl> <dt>If it has a <a data-link-type="dfn" href="#preferred-aspect-ratio" id="ref-for-preferred-aspect-ratio④">preferred aspect ratio</a>: <dd> For the <a data-link-type="dfn" href="#min-content" id="ref-for-min-content①①">min-content size</a>, use zero. <p>For the <a data-link-type="dfn" href="#max-content" id="ref-for-max-content⑨">max-content size</a>:</p> <ul> <li data-md> <p>If the <a data-link-type="dfn" href="#available" id="ref-for-available⑨">available space</a> is <a data-link-type="dfn" href="#definite" id="ref-for-definite⑨">definite</a> in the <a data-link-type="dfn" href="https://drafts.csswg.org/css-writing-modes-4/#inline-axis" id="ref-for-inline-axis③">inline axis</a>, use the <a data-link-type="dfn" href="#stretch-fit" id="ref-for-stretch-fit②">stretch fit</a> into that size for the inline size and calculate the block size using the aspect ratio.</p> <li data-md> <p>Otherwise if the box has a <a class="production css" data-link-type="type" href="https://drafts.csswg.org/css-values-4/#length-value" id="ref-for-length-value③">&lt;length></a> as its <a data-link-type="dfn" href="https://drafts.csswg.org/css-cascade-5/#computed-value" id="ref-for-computed-value①">computed value</a> for <a class="property css" data-link-type="property" href="#propdef-min-width" id="ref-for-propdef-min-width⑤">min-width</a> or <a class="property css" data-link-type="property" href="#propdef-min-height" id="ref-for-propdef-min-height⑤">min-height</a>, use that size and calculate the other dimension using the aspect ratio; if both dimensions have a <span class="production" id="ref-for-length-value④">&lt;length></span> minimum, choose the one that results in the larger overall size.</p> <p class="note" role="note"><span class="marker">Note:</span> This case was previous calculated from a 300x150 default size, rather than the box’s min size. This is believed to be a better behavior, and likely to be Web-compatible, but please send feedback to the CSSWG if there are any problems.</p> <li data-md> <p>Otherwise use an <a data-link-type="dfn" href="https://drafts.csswg.org/css-writing-modes-4/#inline-size" id="ref-for-inline-size⑤">inline size</a> matching the corresponding dimension of the <a data-link-type="dfn" href="https://drafts.csswg.org/css-display-4/#initial-containing-block" id="ref-for-initial-containing-block②">initial containing block</a> and calculate the other dimension using the aspect ratio.</p> </ul> <dt>If it has no <a data-link-type="dfn" href="#preferred-aspect-ratio" id="ref-for-preferred-aspect-ratio⑤">preferred aspect ratio</a>: <dd> For both the <a data-link-type="dfn" href="#min-content" id="ref-for-min-content①②">min-content size</a> and <a data-link-type="dfn" href="#max-content" id="ref-for-max-content①⓪">max-content size</a>: <ul> <li data-md> <p>If the box has a <a class="production css" data-link-type="type" href="https://drafts.csswg.org/css-values-4/#length-value" id="ref-for-length-value⑤">&lt;length></a> as its <a data-link-type="dfn" href="https://drafts.csswg.org/css-cascade-5/#computed-value" id="ref-for-computed-value②">computed</a> <a data-link-type="dfn" href="#min-width" id="ref-for-min-width③">minimum size</a> (<a class="property css" data-link-type="property" href="#propdef-min-width" id="ref-for-propdef-min-width⑥">min-width</a>/<a class="property css" data-link-type="property" href="#propdef-min-height" id="ref-for-propdef-min-height⑥">min-height</a>) in that dimension, use that size.</p> <p class="note" role="note"><span class="marker">Note:</span> This author-controllable behavior is made possible by the new <a class="css" data-link-type="maybe" href="#valdef-width-auto" id="ref-for-valdef-width-auto①②">auto</a> value for the <a data-link-type="dfn" href="#min-size-properties" id="ref-for-min-size-properties③">min size properties</a>. This is believed to be a better behavior, but it is not yet clear if it is Web-compatible, so please send feedback to the CSSWG if there are any problems.</p> <li data-md> <p>Otherwise, use <span class="css">300px</span> for the width and/or <span class="css">150px</span> for the height as needed.</p> </ul> </dl> <p>Since a block-level or inline-level replaced element whose <a class="property css" data-link-type="property" href="#propdef-height" id="ref-for-propdef-height①④">height</a> or <a class="property css" data-link-type="property" href="#propdef-width" id="ref-for-propdef-width①⑥">width</a> <a data-link-type="dfn" href="#behave-as-auto" id="ref-for-behave-as-auto①">behaves as auto</a> is effectively defined to use its <a data-link-type="dfn" href="#max-content" id="ref-for-max-content①①">max-content size</a> (<a href="https://www.w3.org/TR/CSS2/visudet.html#inline-replaced-width">CSS2§10.3.2</a>), this specification applies the rules above to the undefined case of a replaced element whose <span class="property" id="ref-for-propdef-height①⑤">height</span> and <span class="property" id="ref-for-propdef-width①⑦">width</span> both <span id="ref-for-behave-as-auto②">behave as auto</span>.</p> <p class="note" role="note"><span class="marker">Note:</span> This specification does not define how to determine the size of a float. Please refer to <a data-link-type="biblio" href="#biblio-css2" title="Cascading Style Sheets Level 2 Revision 1 (CSS 2.1) Specification">[CSS2]</a>, the relevant CSS specification for that display type, and/or existing implementations for further details. A future specification will define this in detail, replacing the CSS2 “definition”, such as it is.</p> <hr> <p>Although the <a class="css" data-link-type="maybe" href="#valdef-width-auto" id="ref-for-valdef-width-auto①③">auto</a> size of text input controls such as HTML’s <code>&lt;input type=text></code> and <code>&lt;textarea></code> elements is typically a fixed size, the contents of such elements can be used to determine a content-based <a data-link-type="dfn" href="#intrinsic-size" id="ref-for-intrinsic-size③">intrinsic size</a>, as for non-replaced block containers. The <a class="css" data-link-type="maybe" href="#valdef-width-min-content" id="ref-for-valdef-width-min-content④">min-content</a> and <a class="css" data-link-type="maybe" href="#valdef-width-max-content" id="ref-for-valdef-width-max-content④">max-content</a> keywords of the <a data-link-type="dfn" href="#sizing-property" id="ref-for-sizing-property④">sizing properties</a> thus represent content-based sizes for form controls which render their value as text contained within their box, allowing such controls to size to fit their visible contents similarly to regular non-replaced elements.</p> <p>The content in this case is defined to be the input control’s values (the <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/form-elements.html#concept-textarea-raw-value" id="ref-for-concept-textarea-raw-value">raw value</a> in the case of <code><a data-link-type="element" href="https://html.spec.whatwg.org/multipage/form-elements.html#the-textarea-element" id="ref-for-the-textarea-element">textarea</a></code>, or the <a href="https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#concept-fe-value">value</a> in the case of <code><a data-link-type="element" href="https://html.spec.whatwg.org/multipage/input.html#the-input-element" id="ref-for-the-input-element">input</a></code>), possibly transformed to a more human-readable and/or localized display format, which is then treated as child <a data-link-type="dfn" href="https://drafts.csswg.org/css-display-4/#css-text-sequence" id="ref-for-css-text-sequence">text sequences</a> of the input control, allowing <a data-link-type="dfn" href="https://drafts.csswg.org/css-text-4/#soft-wrap-opportunity" id="ref-for-soft-wrap-opportunity">soft wrap opportunities</a> only where the input control would actually allow wrapping (whether keyed off of CSS properties or other, UA-internal constraints). If the input control has designated placeholder text to be overlaid in its value display area, then that text is also measured for the purpose of calculating the content-based size—​whether or not the placeholder text is visible at the moment. (Thus the content-based <a data-link-type="dfn" href="#intrinsic-size" id="ref-for-intrinsic-size④">intrinsic size</a> of the input control is the larger of the size to fit the placeholder text and the size to fit the value.)</p> <p>The UA may enforce a minimum (such as the size required to contain a single zero-width character, or the smallest usable size of a touch target) on the form control’s <a data-link-type="dfn" href="#min-content" id="ref-for-min-content①③">min-content</a> and <a data-link-type="dfn" href="#max-content" id="ref-for-max-content①②">max-content sizes</a> to ensure sufficient space for the caret and otherwise maintain usability of the form control.</p> <p class="note" role="note"><span class="marker">Note:</span> This might be extended to <code><a data-link-type="element" href="https://html.spec.whatwg.org/multipage/iframe-embed-object.html#the-iframe-element" id="ref-for-the-iframe-element">iframe</a></code> or other content-containing replaced elements (see <a href="https://github.com/w3c/csswg-drafts/issues/1771">discussion</a>), but text inputs are a major use-case; and being document-internal, have the least additional complications.</p> <h3 class="heading settled" data-level="5.2" id="intrinsic-contribution"><span class="secno">5.2. </span><span class="content"> Intrinsic Contributions</span><a class="self-link" href="#intrinsic-contribution"></a></h3> <p>A box’s <a data-link-type="dfn" href="#min-content-contribution" id="ref-for-min-content-contribution②">min-content contribution</a>/<a data-link-type="dfn" href="#max-content-contribution" id="ref-for-max-content-contribution②">max-content contribution</a> in each axis is the size of the content box of a hypothetical <a class="css" data-link-type="maybe" href="#valdef-width-auto" id="ref-for-valdef-width-auto①④">auto</a>-sized float that contains only that box, if that hypothetical float’s containing block is zero-sized/infinitely-sized.</p> <p class="note" role="note"><span class="marker">Note:</span> This specification does not define precisely how to determine these sizes. Please refer to <a data-link-type="biblio" href="#biblio-css2" title="Cascading Style Sheets Level 2 Revision 1 (CSS 2.1) Specification">[CSS2]</a>, the relevant CSS specification for that display type, the <a href="#percentage-sizing">rules for handling percentages</a> (below), and/or existing implementations for further details.</p> <h4 class="heading settled" data-level="5.2.1" id="cyclic-percentage-contribution"><span class="secno">5.2.1. </span><span class="content"> Intrinsic Contributions of Percentage-Sized Boxes</span><a class="self-link" href="#cyclic-percentage-contribution"></a></h4> <p>Sometimes the size of a percentage-sized box’s <a data-link-type="dfn" href="https://drafts.csswg.org/css-display-4/#containing-block" id="ref-for-containing-block①③">containing block</a> depends on the <a data-link-type="dfn" href="#intrinsic-size-contribution" id="ref-for-intrinsic-size-contribution">intrinsic size contribution</a> of the box itself, creating a cyclic dependency. When calculating the <span id="ref-for-intrinsic-size-contribution①">intrinsic size contribution</span> of such a box (including any calculations for a content-based <a data-link-type="dfn" href="#automatic-minimum-size" id="ref-for-automatic-minimum-size">automatic minimum size</a>), a percentage value that resolves against a size in the same axis as the <span id="ref-for-intrinsic-size-contribution②">intrinsic size contribution</span> (a <dfn class="dfn-paneled" data-dfn-type="dfn" data-export data-local-lt="cyclic percentage" id="cyclic-percentage-size">cyclic percentage size</dfn>) is resolved specially:</p> <ol type="a"> <li id="non-replaced-percentage-contribution"><a class="self-link" href="#non-replaced-percentage-contribution"></a> If the box is <a data-link-type="dfn" href="https://drafts.csswg.org/css-display-4/#non-replaced" id="ref-for-non-replaced①">non-replaced</a>, then the entire value of any <a data-link-type="dfn" href="#max-size-properties" id="ref-for-max-size-properties④">max size property</a> or <a data-link-type="dfn" href="#preferred-size-properties" id="ref-for-preferred-size-properties④">preferred size property</a> (<a class="property css" data-link-type="property" href="#propdef-width" id="ref-for-propdef-width①⑧">width</a>/<a class="property css" data-link-type="property" href="#propdef-max-width" id="ref-for-propdef-max-width④">max-width</a>/<a class="property css" data-link-type="property" href="#propdef-height" id="ref-for-propdef-height①⑥">height</a>/<a class="property css" data-link-type="property" href="#propdef-max-height" id="ref-for-propdef-max-height④">max-height</a>) specified as an expression <a data-link-type="dfn" href="https://drafts.csswg.org/css-values-4/#css-contain-a-percentage" id="ref-for-css-contain-a-percentage">containing a percentage</a> (such as <span class="css">10%</span> or <span class="css">calc(10px + 0%)</span>) that is <a data-link-type="dfn" href="#cyclic-percentage-size" id="ref-for-cyclic-percentage-size">cyclic</a> is treated <em>for the purpose of calculating the box’s <a data-link-type="dfn" href="#intrinsic-size-contribution" id="ref-for-intrinsic-size-contribution③">intrinsic size contributions</a> only</em> as that property’s <a data-link-type="dfn" href="https://drafts.csswg.org/css-cascade-5/#initial-value" id="ref-for-initial-value">initial value</a>. For example, given a box with <span class="css" id="ref-for-propdef-width①⑨">width: calc(20px + 50%)</span>, its max-content contribution is calculated as if its <span class="property" id="ref-for-propdef-width②⓪">width</span> were <a class="css" data-link-type="maybe" href="#valdef-width-auto" id="ref-for-valdef-width-auto①⑤">auto</a>. (The percentage is honored as usual, however, during the actual sizing of the box itself; see below.) <li id="replaced-percentage-max-contribution"><a class="self-link" href="#replaced-percentage-max-contribution"></a> Likewise, if the box is <a data-link-type="dfn" href="https://drafts.csswg.org/css-display-4/#replaced-element" id="ref-for-replaced-element②">replaced</a>, then the entire value of any <a data-link-type="dfn" href="#max-size-properties" id="ref-for-max-size-properties①">max size property</a> or <a data-link-type="dfn" href="#preferred-size-properties" id="ref-for-preferred-size-properties①">preferred size property</a> specified as an expression containing a percentage that is <a data-link-type="dfn" href="#cyclic-percentage-size" id="ref-for-cyclic-percentage-size①">cyclic</a> is treated <em>for the purpose of calculating the box’s <a data-link-type="dfn" href="#max-content-contribution" id="ref-for-max-content-contribution③">max-content contributions</a> only</em> as that property’s <a data-link-type="dfn" href="https://drafts.csswg.org/css-cascade-5/#initial-value" id="ref-for-initial-value①">initial value</a>. <li id="replaced-percentage-min-contribution"> <a class="self-link" href="#replaced-percentage-min-contribution"></a> If the box is <a data-link-type="dfn" href="https://drafts.csswg.org/css-display-4/#replaced-element" id="ref-for-replaced-element③">replaced</a>, a <a data-link-type="dfn" href="#cyclic-percentage-size" id="ref-for-cyclic-percentage-size②">cyclic percentage</a> in the value of any <a data-link-type="dfn" href="#max-size-properties" id="ref-for-max-size-properties②">max size property</a> or <a data-link-type="dfn" href="#preferred-size-properties" id="ref-for-preferred-size-properties②">preferred size property</a> (<a class="property css" data-link-type="property" href="#propdef-width" id="ref-for-propdef-width②①">width</a>/<a class="property css" data-link-type="property" href="#propdef-max-width" id="ref-for-propdef-max-width⑤">max-width</a>/<a class="property css" data-link-type="property" href="#propdef-height" id="ref-for-propdef-height①⑦">height</a>/<a class="property css" data-link-type="property" href="#propdef-max-height" id="ref-for-propdef-max-height⑤">max-height</a>), is resolved against zero when calculating the <a data-link-type="dfn" href="#min-content-contribution" id="ref-for-min-content-contribution③">min-content contribution</a> in the corresponding axis. (See <a href="#min-content-zero">§ 5.2.2 Compressible Replaced Elements</a> for a list of which elements in HTML this applies to.) If the box also has a <a data-link-type="dfn" href="#preferred-aspect-ratio" id="ref-for-preferred-aspect-ratio⑥">preferred aspect ratio</a>, then this <span id="ref-for-min-content-contribution④">min-content contribution</span> is floored by any <a class="production css" data-link-type="type" href="https://drafts.csswg.org/css-values-4/#typedef-length-percentage" id="ref-for-typedef-length-percentage②④">&lt;length-percentage></a> <a data-link-type="dfn" href="#min-width" id="ref-for-min-width④">minimum size</a> from the opposite axis—​resolving any such percentage against zero—​transferred through the <span id="ref-for-preferred-aspect-ratio⑦">preferred aspect ratio</span>. <p class="issue" id="issue-1b92b23f"><a class="self-link" href="#issue-1b92b23f"></a> Should we resolve transferred percentages against their containing block instead of zero before transferring them? See <a href="https://github.com/w3c/csswg-drafts/issues/6341">discussion</a>.</p> <p>The UA may additionally floor the <a data-link-type="dfn" href="#min-content-contribution" id="ref-for-min-content-contribution⑤">min-content contribution</a> based on UI considerations, such as ensuring certain UI elements remain visible (for example, the dropdown arrow on a <code><a data-link-type="element" href="https://html.spec.whatwg.org/multipage/form-elements.html#the-select-element" id="ref-for-the-select-element">select</a></code>).</p> <p class="note" role="note"><span class="marker">Note:</span> The <a data-link-type="dfn" href="#min-content-contribution" id="ref-for-min-content-contribution⑥">min-content contribution</a> is, as always, also floored by the <a data-link-type="dfn" href="#min-width" id="ref-for-min-width⑤">minimum size</a> in its own axis.</p> <p>This rule also applies when calculating a content-based <a data-link-type="dfn" href="#automatic-minimum-size" id="ref-for-automatic-minimum-size①">automatic minimum size</a> or its corresponding size contribution, yielding a <a data-link-type="dfn" href="#definite" id="ref-for-definite①⓪">definite</a> “specified size suggestion”.</p> <div class="example" id="example-b06093ff"><a class="self-link" href="#example-b06093ff"></a> For example, an <code><a data-link-type="element" href="https://html.spec.whatwg.org/multipage/input.html#the-input-element" id="ref-for-the-input-element①">input</a></code> assigned <a class="css" data-link-type="propdesc" href="#propdef-width" id="ref-for-propdef-width②②">width: calc(50% + 50px)</a> has a <a data-link-type="dfn" href="#min-content-contribution" id="ref-for-min-content-contribution⑦">min-content contribution</a> of <span class="css">50px</span>, plus any horizontal margin/border/padding. </div> <li id="min-percentage-contribution"><a class="self-link" href="#min-percentage-contribution"></a> For the <a data-link-type="dfn" href="#min-size-properties" id="ref-for-min-size-properties①">min size properties</a>, as well as for <a data-link-type="dfn" href="https://drafts.csswg.org/css-box-4/#margin" id="ref-for-margin">margins</a> and <a data-link-type="dfn" href="https://drafts.csswg.org/css-box-4/#padding" id="ref-for-padding">paddings</a> (and <a data-link-type="dfn" href="https://drafts.csswg.org/css-align-3/#gutter" id="ref-for-gutter">gutters</a>), a <a data-link-type="dfn" href="#cyclic-percentage-size" id="ref-for-cyclic-percentage-size③">cyclic percentage</a> is resolved against zero for determining <a data-link-type="dfn" href="#intrinsic-size-contribution" id="ref-for-intrinsic-size-contribution④">intrinsic size contributions</a>. </ol> <table class="data"> <caption>Summary of the Cyclic-Percentage Intrinsic Size Contribution Rules (Above)</caption> <colgroup span="1"> <colgroup span="2"> <colgroup span="2"> <thead> <tr> <th scope="row">Element Type <th colspan="2" scope="colgroup"><a data-link-type="dfn" href="https://drafts.csswg.org/css-display-4/#replaced-element" id="ref-for-replaced-element④">Replaced</a> <th colspan="2" scope="colgroup"><a data-link-type="dfn" href="https://drafts.csswg.org/css-display-4/#non-replaced" id="ref-for-non-replaced②">Non-replaced</a> <tr> <th scope="row">Contribution Type <th scope="col"><a data-link-type="dfn" href="#min-content-contribution" id="ref-for-min-content-contribution⑧">min-content</a> <th scope="col"><a data-link-type="dfn" href="#max-content-contribution" id="ref-for-max-content-contribution④">max-content</a> <th scope="col"><a data-link-type="dfn" href="#min-content-contribution" id="ref-for-min-content-contribution⑨">min-content</a> <th scope="col"><a data-link-type="dfn" href="#max-content-contribution" id="ref-for-max-content-contribution⑤">max-content</a> <tbody> <tr> <th scope="row"><a data-link-type="dfn" href="#min-size-properties" id="ref-for-min-size-properties②">min size</a> &amp; <a data-link-type="dfn" href="https://drafts.csswg.org/css-box-4/#margin-properties" id="ref-for-margin-properties">margin</a>/<a data-link-type="dfn" href="https://drafts.csswg.org/css-box-4/#padding-properties" id="ref-for-padding-properties">padding</a> <td><a href="#min-percentage-contribution">zeroᵈ</a> <td><a href="#min-percentage-contribution">zeroᵈ</a> <td><a href="#min-percentage-contribution">zeroᵈ</a> <td><a href="#min-percentage-contribution">zeroᵈ</a> <tr> <th scope="row"><a data-link-type="dfn" href="#max-size-properties" id="ref-for-max-size-properties③">max</a> &amp; <a data-link-type="dfn" href="#preferred-size-properties" id="ref-for-preferred-size-properties③">preferred size</a> <td><a href="#replaced-percentage-min-contribution">zeroᶜ</a> <td><a href="#replaced-percentage-max-contribution">initialᵇ</a> <td><a href="#non-replaced-percentage-contribution">initialᵃ</a> <td><a href="#non-replaced-percentage-contribution">initialᵃ</a> </table> <p>Then, unless otherwise specified, when calculating the used sizes and positions of the containing block’s <em>contents</em>:</p> <ul> <li data-md> <p>If the cyclic dependency was introduced due to a <a data-link-type="dfn" href="https://drafts.csswg.org/css-writing-modes-4/#block-axis" id="ref-for-block-axis②">block-axis</a> size other than a <a data-link-type="dfn" href="#min-width" id="ref-for-min-width⑥">minimum size</a> on the containing block (i.e. a <a class="property css" data-link-type="property" href="https://drafts.csswg.org/css-logical-1/#propdef-block-size" id="ref-for-propdef-block-size">block-size</a> or <a class="property css" data-link-type="property" href="https://drafts.csswg.org/css-logical-1/#propdef-max-block-size" id="ref-for-propdef-max-block-size">max-block-size</a> in most layout modes, or a <a class="property css" data-link-type="property" href="https://drafts.csswg.org/css-flexbox-1/#propdef-flex-basis" id="ref-for-propdef-flex-basis②">flex-basis</a> in <a data-link-type="dfn" href="https://drafts.csswg.org/css-flexbox-1/#flex-layout" id="ref-for-flex-layout">flex layout</a>) that causes it to depend on the size of its contents, the box’s percentage is not resolved and instead <a data-link-type="dfn" href="#behave-as-auto" id="ref-for-behave-as-auto③">behaves as auto</a>.</p> <p class="note" role="note"><span class="marker">Note:</span> <a data-link-type="dfn" href="https://drafts.csswg.org/css-grid-2/#grid-item" id="ref-for-grid-item">Grid items</a> and <a data-link-type="dfn" href="https://drafts.csswg.org/css-flexbox-1/#flex-item" id="ref-for-flex-item">flex items</a> do allow percentages to resolve in this case.</p> <li data-md> <p>Otherwise, the percentage is resolved against the containing block’s size. (The containing block’s size is not re-resolved based on the resulting size of the box; the contents might thus overflow or underflow the containing block).</p> </ul> <p class="note" role="note"><span class="marker">Note:</span> These rules specify the previously-undefined behavior of this cyclic case in <a href="https://www.w3.org/TR/CSS2/visudet.html#the-width-property">CSS2§10.2</a>, <a href="https://www.w3.org/TR/CSS2/box.html#margin-properties">CSS2§8.3</a>, and <a href="https://www.w3.org/TR/CSS2/box.padding-properties">CSS2§8.4</a>. Note also, the behavior in <a href="https://www.w3.org/TR/CSS2/visudet.html#the-height-property">CSS2§10.5</a> is superseded in their respective specifications for layout modes (such as <a href="http://www.w3.org/TR/css-flexbox/">flex layout</a>) not described in CSS2.</p> <div class="example" id="example-a57016da"> <a class="self-link" href="#example-a57016da"></a> For example, in the following markup: <pre class="lang-html highlight"><c- p>&lt;</c-><c- f>article</c-> <c- e>style</c-><c- o>=</c-><c- s>"width: min-content"</c-><c- p>></c-> <c- p>&lt;</c-><c- f>aside</c-> <c- e>style</c-><c- o>=</c-><c- s>"width: 50%;"</c-><c- p>></c-> LOOOOOOOOOOOOOOOOOOOONG <c- p>&lt;/</c-><c- f>aside</c-><c- p>></c-> <c- p>&lt;/</c-><c- f>article</c-><c- p>></c-> </pre> <p>When calculating the width of the outer <code>&lt;article></code>, the inner <code>&lt;aside></code> behaves as <a class="css" data-link-type="propdesc" href="#propdef-width" id="ref-for-propdef-width②③">width: auto</a>, so the <code>&lt;article></code> sets itself to the width of the long word. Since the <code>&lt;article></code>’s width didn’t depend on "real" layout, though, it’s treated as <a data-link-type="dfn" href="#definite" id="ref-for-definite①①">definite</a> for resolving the <code>&lt;aside></code>, whose width resolves to half that of the <code>&lt;article></code>.</p> </div> <div class="example" id="example-a6fc9bae"> <a class="self-link" href="#example-a6fc9bae"></a> In this example, <pre class="lang-html highlight"><c- p>&lt;</c-><c- f>article</c-> <c- e>style</c-><c- o>=</c-><c- s>"height:auto"</c-><c- p>></c-> <c- p>&lt;</c-><c- f>aside</c-> <c- e>style</c-><c- o>=</c-><c- s>"height: 50%;"</c-><c- p>></c-> <c- p>&lt;</c-><c- f>div</c-> <c- e>class</c-><c- o>=</c-><c- s>block</c-> <c- e>style</c-><c- o>=</c-><c- s>"height: 150px;"</c-><c- p>>&lt;/</c-><c- f>div</c-><c- p>></c-> <c- p>&lt;/</c-><c- f>aside</c-><c- p>></c-> <c- p>&lt;</c-><c- f>section</c-> <c- e>style</c-><c- o>=</c-><c- s>"height: 30px;"</c-><c- p>>&lt;/</c-><c- f>section</c-><c- p>></c-> <c- p>&lt;/</c-><c- f>article</c-><c- p>></c-> </pre> <p>because the percentage <a data-link-type="dfn" href="https://drafts.csswg.org/css-writing-modes-4/#block-size" id="ref-for-block-size⑥">block size</a> (<a class="property css" data-link-type="property" href="#propdef-height" id="ref-for-propdef-height①⑧">height</a>, in this case) on block-level elements is defined to not resolve inside content-sized containing blocks, the percentage height on the <code>&lt;aside></code> is ignored, that is, it behaves exactly as if <a class="css" data-link-type="maybe" href="#valdef-width-auto" id="ref-for-valdef-width-auto①⑥">auto</a> were specified.</p> </div> <div class="example" id="example-8559f728"> <a class="self-link" href="#example-8559f728"></a> <p class="issue" id="issue-9b3707fe"><a class="self-link" href="#issue-9b3707fe"></a> Letting percentages still resolve against a definite <a class="property css" data-link-type="property" href="#propdef-height" id="ref-for-propdef-height①⑨">height</a> when the min-height is intrinsic is an open issue. (CSS2 has a general statement about "height depending on contents", which this technically is, even though CSS2 didn’t have content-dependent keywords for <a class="property css" data-link-type="property" href="#propdef-min-height" id="ref-for-propdef-min-height⑦">min-height</a>. Since this is new, we think we could have this different behavior.)</p> <p>The following examples illustrate how block-axis percentages resolve against a containing block whose size depends on its contents.</p> <pre class="lang-html highlight"><c- p>&lt;</c-><c- f>article</c-> <c- e>style</c-><c- o>=</c-><c- s>"height:100px; min-height: min-content;"</c-><c- p>></c-> <c- p>&lt;</c-><c- f>aside</c-> <c- e>style</c-><c- o>=</c-><c- s>"height: 50%;"</c-><c- p>></c-> <c- p>&lt;</c-><c- f>div</c-> <c- e>style</c-><c- o>=</c-><c- s>"height: 150px;"</c-><c- p>>&lt;/</c-><c- f>div</c-><c- p>></c-> <c- p>&lt;/</c-><c- f>aside</c-><c- p>></c-> <c- p>&lt;</c-><c- f>section</c-> <c- e>style</c-><c- o>=</c-><c- s>"height: 30px;"</c-><c- p>>&lt;/</c-><c- f>section</c-><c- p>></c-> <c- p>&lt;/</c-><c- f>article</c-><c- p>></c-> </pre> <p>The initial height of the <code>&lt;article></code> is 100px, as specified, which would make the <code>&lt;aside></code> 50px tall when it resolved its percentage. However, we must calculate the min-height, by substituting it in for <a class="property css" data-link-type="property" href="#propdef-height" id="ref-for-propdef-height②⓪">height</a>. This causes the percentage on the <code>&lt;aside></code> to <a data-link-type="dfn" href="#behave-as-auto" id="ref-for-behave-as-auto④">behave as auto</a>, so the <code>&lt;aside></code> ends up 150px tall. The total height of the contents is thus 180px. This is larger than the specified 100px height, so the <code>&lt;article></code> gets adjusted to 180px tall.</p> <p>Then, since the percentage could <em>originally</em> resolve against the (100px) height, it now resolves against the 180px height, so the <code>&lt;aside></code> ends up being 90px tall.</p> <pre class="lang-html highlight"><c- p>&lt;</c-><c- f>article</c-> <c- e>style</c-><c- o>=</c-><c- s>"height:auto; min-height: min-content;"</c-><c- p>></c-> <c- p>&lt;</c-><c- f>aside</c-> <c- e>style</c-><c- o>=</c-><c- s>"height: 50%;"</c-><c- p>></c-> <c- p>&lt;</c-><c- f>div</c-> <c- e>class</c-><c- o>=</c-><c- s>block</c-> <c- e>style</c-><c- o>=</c-><c- s>"height: 150px;"</c-><c- p>>&lt;/</c-><c- f>div</c-><c- p>></c-> <c- p>&lt;/</c-><c- f>aside</c-><c- p>></c-> <c- p>&lt;</c-><c- f>section</c-> <c- e>style</c-><c- o>=</c-><c- s>"height: 30px;"</c-><c- p>>&lt;/</c-><c- f>section</c-><c- p>></c-> <c- p>&lt;/</c-><c- f>article</c-><c- p>></c-> </pre> <p>In this case, the percentage on the <code>&lt;aside></code> won’t normally resolve, because the containing block’s height is <a class="css" data-link-type="maybe" href="#valdef-width-auto" id="ref-for-valdef-width-auto①⑦">auto</a> (and thus depends on the size of its contents). Instead it <a data-link-type="dfn" href="#behave-as-auto" id="ref-for-behave-as-auto⑤">behaves as auto</a>, resulting in a height of 150px for the <code>&lt;aside></code>, and an initial height of 180px for the <code>&lt;article></code> The <a class="property css" data-link-type="property" href="#propdef-min-height" id="ref-for-propdef-min-height⑧">min-height</a> doesn’t change this; <a class="css" data-link-type="propdesc" href="#propdef-height" id="ref-for-propdef-height②①">height: min-content;</a> acts similarly to <span class="css" id="ref-for-propdef-height②②">height: auto;</span> and results in the same sizes.</p> <pre class="lang-html highlight"><c- p>&lt;</c-><c- f>article</c-> <c- e>style</c-><c- o>=</c-><c- s>"height:100px; min-height: min-content;"</c-><c- p>></c-> <c- p>&lt;</c-><c- f>aside</c-> <c- e>style</c-><c- o>=</c-><c- s>"height: 200%;"</c-><c- p>></c-> <c- p>&lt;</c-><c- f>div</c-> <c- e>style</c-><c- o>=</c-><c- s>"height: 150px;"</c-><c- p>>&lt;/</c-><c- f>div</c-><c- p>></c-> <c- p>&lt;/</c-><c- f>aside</c-><c- p>></c-> <c- p>&lt;</c-><c- f>section</c-> <c- e>style</c-><c- o>=</c-><c- s>"height: 30px;"</c-><c- p>>&lt;/</c-><c- f>section</c-><c- p>></c-> <c- p>&lt;/</c-><c- f>article</c-><c- p>></c-> </pre> <p>This is a variation on the first code block, and follows a similar path; the <code>&lt;aside></code> initially wants to compute to 200px tall (200% of the 100px containing block height). When we calculate the effects of <a class="property css" data-link-type="property" href="#propdef-min-height" id="ref-for-propdef-min-height⑨">min-height</a>, the percentage <a data-link-type="dfn" href="#behave-as-auto" id="ref-for-behave-as-auto⑥">behaves as auto</a>, causing it to become 150px tall, and the total <a class="css" data-link-type="maybe" href="#valdef-width-min-content" id="ref-for-valdef-width-min-content⑤">min-content</a> height of the containing block to be 180px tall. Since this is larger than 100px, the <code>&lt;article></code> gets clamped to 180px, the percentage resolves against this new height, and the <code>&lt;aside></code> ends up being 360px tall, overflowing the <code>&lt;article></code></p> </div> <h4 class="heading settled" data-level="5.2.2" id="min-content-zero"><span class="secno">5.2.2. </span><span class="content"> Compressible Replaced Elements</span><a class="self-link" href="#min-content-zero"></a></h4> <p>In addition to the <a data-link-type="dfn" href="https://drafts.csswg.org/css-display-4/#replaced-element" id="ref-for-replaced-element⑤">replaced elements</a> listed in <a href="https://html.spec.whatwg.org/multipage/rendering.html#replaced-elements">HTML§14.4</a> <a data-link-type="biblio" href="#biblio-html" title="HTML Standard">[HTML]</a>, the following HTML elements are also considered to be <span id="ref-for-replaced-element⑥">replaced elements</span> for the purpose of the <a href="#replaced-percentage-min-contribution">percentage-sized replaced element rule</a> above, and can have their <a data-link-type="dfn" href="#min-content-contribution" id="ref-for-min-content-contribution①⓪">min-content contribution</a> compressed when their <a class="property css" data-link-type="property" href="#propdef-width" id="ref-for-propdef-width②④">width</a>/<a class="property css" data-link-type="property" href="#propdef-height" id="ref-for-propdef-height②③">height</a> or <a class="property css" data-link-type="property" href="#propdef-max-width" id="ref-for-propdef-max-width⑥">max-width</a>/<a class="property css" data-link-type="property" href="#propdef-max-height" id="ref-for-propdef-max-height⑥">max-height</a> is expressed with a cyclic percentage size:</p> <ul> <li data-md> <p><code><a data-link-type="element" href="https://html.spec.whatwg.org/multipage/input.html#the-input-element" id="ref-for-the-input-element②">input</a></code> with any <code><a data-link-type="element-sub" href="https://html.spec.whatwg.org/multipage/input.html#attr-input-type" id="ref-for-attr-input-type">type</a></code> that is not "button-like"; this can vary depending on the UA.</p> <p>A type is "button-like" in a particular UA if it displays similar to a <code><a data-link-type="element" href="https://html.spec.whatwg.org/multipage/form-elements.html#the-button-element" id="ref-for-the-button-element①">button</a></code> element, where it can contains actual content that determines the layout of the element. In most UAs, the "button", "reset", "submit", and "color" types are button-like; the "file" type is also partially button-like in some UAs, when it’s displayed as a combination of a text input (shrinkable) and a button (button-like, and thus not shrinkable).</p> <li data-md> <p><code><a data-link-type="element" href="https://html.spec.whatwg.org/multipage/form-elements.html#the-select-element" id="ref-for-the-select-element①">select</a></code>, <code><a data-link-type="element" href="https://html.spec.whatwg.org/multipage/form-elements.html#the-textarea-element" id="ref-for-the-textarea-element①">textarea</a></code>, <code><a data-link-type="element" href="https://html.spec.whatwg.org/multipage/form-elements.html#the-progress-element" id="ref-for-the-progress-element">progress</a></code>, <code><a data-link-type="element" href="https://html.spec.whatwg.org/multipage/form-elements.html#the-meter-element" id="ref-for-the-meter-element">meter</a></code>, <code><a data-link-type="element" href="https://html.spec.whatwg.org/multipage/obsolete.html#the-marquee-element" id="ref-for-the-marquee-element">marquee</a></code>.</p> </ul> <p class="issue" id="issue-d999780f"><a class="self-link" href="#issue-d999780f"></a> Tracking web-compat &amp; implementation progress of applying this to max-width/height in <a href="https://github.com/w3c/csswg-drafts/issues/6348">Issue 6348</a>. <a href="https://github.com/w3c/csswg-drafts/issues/6348">[Issue #6348]</a></p> <h2 class="no-num heading settled" id="changes"><span class="content"> Changes</span><a class="self-link" href="#changes"></a></h2> <h3 class="no-num heading settled" id="changes-recent"><span class="content"> Recent Changes</span><a class="self-link" href="#changes-recent"></a></h3> <p> Changes since the <a href="https://www.w3.org/TR/2020/WD-css-sizing-3-20201218/">18 December 2020 Working Draft</a> include: </p> <ul> <li>Fixed the order of <a class="property css" data-link-type="property">contain-intrinsic</a> size values when <a class="css" data-link-type="maybe" href="https://drafts.csswg.org/css-sizing-4/#valdef-contain-intrinsic-width-auto" id="ref-for-valdef-contain-intrinsic-width-auto">auto</a> is combined with other values so that parsing is unambiguous. (<a href="https://github.com/w3c/csswg-drafts/issues/6391">Issue 6391</a>) <li>Clarified which elements are allowed to not have a last remembered size for <a class="css" data-link-type="propdesc" href="https://drafts.csswg.org/css-sizing-4/#propdef-contain-intrinsic-size" id="ref-for-propdef-contain-intrinsic-size">contain-intrinsic-size: auto</a>. (<a href="https://github.com/w3c/csswg-drafts/issues/6220">Issue 6220</a>) <li>Limited <a class="css" data-link-type="propdesc" href="https://drafts.csswg.org/css-sizing-4/#propdef-contain-intrinsic-size" id="ref-for-propdef-contain-intrinsic-size①">contain-intrinsic-size: auto</a> to when <span class="css">content-visibility' is </span>content-visibility/auto''. (<a href="https://github.com/w3c/csswg-drafts/issues/6308">Issue 6308</a>) </ul> <p> Changes since the <a href="https://www.w3.org/TR/2020/WD-css-sizing-3-20201218/">18 December 2020 Working Draft</a> include: </p> <ul> <li> Fixed various errors in definition of max-content sizes of replaced elements in <a href="#intrinsic-sizes">§ 5.1 Intrinsic Sizes</a>. (<a href="https://github.com/w3c/csswg-drafts/issues/6072">Issue 6072</a>) <li> Added missing statement handling <a data-link-type="dfn" href="#min-content-constraint" id="ref-for-min-content-constraint③">min-content constraint</a> to definition of <a data-link-type="dfn" href="#fit-content-size" id="ref-for-fit-content-size①">fit-content size</a>. <li> Renamed replaced element “intrinsic” dimensions to “natural” dimensions in order to avoid confusion with <a data-link-type="dfn" href="#intrinsic-size" id="ref-for-intrinsic-size⑤">intrinsic sizes</a> (see <a href="https://github.com/w3c/csswg-drafts/issues/4961">Issue 4961</a>). <li> Various other minor editorial fixes and improvements. </ul> <p> Major changes since the <a href="https://www.w3.org/TR/2019/WD-css-sizing-3-20190522/">22 May 2019 Working Draft</a> include: </p> <ul> <li> Defined that <a class="css" data-link-type="maybe" href="#valdef-width-min-content" id="ref-for-valdef-width-min-content⑥">min-content</a> and <a class="css" data-link-type="maybe" href="#valdef-width-max-content" id="ref-for-valdef-width-max-content⑤">max-content</a> do not necessarily behave the same as the property’s initial value if otherwise specified (by the relevant layout module). (<a href="https://github.com/w3c/csswg-drafts/issues/3973">Issue 3973</a>) <li> Switched intrinsic contribution of <a class="css" data-link-type="maybe" href="#funcdef-width-fit-content" id="ref-for-funcdef-width-fit-content⑥">fit-content()</a> to treat its argument as that argument would be treated alone for intrinsic contribution calculations and resolve the fit-content formula accordingly, rather than having special behavior for <span class="css" id="ref-for-funcdef-width-fit-content⑦">fit-content()</span> resolution when calculating intrinsic contributions. (<a href="https://github.com/w3c/csswg-drafts/issues/3731">Issue 3731</a>) <li> Changed the <a data-link-type="dfn" href="#max-content" id="ref-for-max-content①③">max-content size</a> of replaced boxes without an intrinsic size to use their <a data-link-type="dfn" href="#min-width" id="ref-for-min-width⑦">minimum size</a> in place of ICB or 300px×150px only when it is a <a class="production css" data-link-type="type" href="https://drafts.csswg.org/css-values-4/#length-value" id="ref-for-length-value⑥">&lt;length></a>, see <a href="#intrinsic-sizes">§ 5.1 Intrinsic Sizes</a>. (<a href="https://github.com/w3c/csswg-drafts/issues/4217">Issue 4217</a>) <li> Switched default sizing of an object with a natural aspect ratio to use the ICB size instead of 300px×150px. (<a href="https://github.com/w3c/csswg-drafts/issues/4218">Issue 4218</a>) <li> Defined <a data-link-type="dfn" href="#preferred-aspect-ratio" id="ref-for-preferred-aspect-ratio⑧">preferred aspect ratio</a> and used it in place of “intrinsic aspect ratio” where appropriate. <li> Miscellaneous minor / editorial fixes. </ul> <p> Major changes since the <a href="https://www.w3.org/TR/2018/WD-css-sizing-3-20180304/">4 March 2018 Working Draft</a> include: </p> <ul> <li>Imported the <a class="property css" data-link-type="property" href="#propdef-box-sizing" id="ref-for-propdef-box-sizing⑦">box-sizing</a> definition from <a href="https://www.w3.org/TR/css-ui-3/">CSS UI Level 3</a>. <li>More rigorously specified handling of <a data-link-type="dfn" href="#cyclic-percentage-size" id="ref-for-cyclic-percentage-size④">cyclic percentages</a>. (<a href="https://github.com/w3c/csswg-drafts/issues/1132">#1132</a>, <a href="https://github.com/w3c/csswg-drafts/issues/2384">#2384</a>, <a href="https://github.com/w3c/csswg-drafts/issues/2297">#2297</a>, <a href="https://github.com/w3c/csswg-drafts/issues/2674">#2674</a>) <li>Changed the <span class="css">*-content</span> values applied to the bock axis to not compute to the property’s initial value, but to rather “behave as” the property’s initial value. (<a href="https://github.com/w3c/csswg-drafts/issues/2708">#2708</a>) <li>Fixed miscellaneous trivial errors. </ul> <p> Major changes since the <a href="https://www.w3.org/TR/2017/WD-css-sizing-3-20170207/">7 February 2017 Working Draft</a> include: </p> <ul> <li>More accurate definition of min-content and max-content sizes for replaced elements. <li>Compute new keywords to the initial value, not to a potentially non-existent <a class="css" data-link-type="maybe" href="#valdef-width-auto" id="ref-for-valdef-width-auto①⑧">auto</a>, when applied to the block axis. <li>Specify that percent sizes on replaced elements zero out their min-content contribution. <li>Fix confusing/wrong definition of percentage sizes resolved against a dependent containing block. (This may require further work.) <li>Deferred the <a class="css" data-link-type="maybe" href="https://drafts.csswg.org/css-sizing-4/#valdef-width-stretch" id="ref-for-valdef-width-stretch②">stretch</a> and <a class="css" data-link-type="maybe" href="https://drafts.csswg.org/css-sizing-4/#valdef-width-fit-content" id="ref-for-valdef-width-fit-content①">fit-content</a> keywords to Level 4 to allow for further consideration of their behavior in <a data-link-type="dfn" href="#indefinite" id="ref-for-indefinite⑥">indefinite</a> containing blocks. <li>Pulled in full definitions for all of the sizing properties (rather than diffing them): <a class="property css" data-link-type="property" href="#propdef-width" id="ref-for-propdef-width②⑤">width</a>, <a class="property css" data-link-type="property" href="#propdef-height" id="ref-for-propdef-height②④">height</a>, <a class="property css" data-link-type="property" href="#propdef-min-width" id="ref-for-propdef-min-width⑦">min-width</a>, <a class="property css" data-link-type="property" href="#propdef-min-height" id="ref-for-propdef-min-height①⓪">min-height</a>, max-width', <a class="property css" data-link-type="property" href="#propdef-max-height" id="ref-for-propdef-max-height⑦">max-height</a>, and <a class="property css" data-link-type="property" href="#propdef-box-sizing" id="ref-for-propdef-box-sizing⑧">box-sizing</a>. </ul> <h3 class="no-num heading settled" id="changes-3"><span class="content"> Additions since CSS Level 2</span><a class="self-link" href="#changes-3"></a></h3> <p>In addition to substantially more detail to the various automatic and content-based sizing algorithms, the following new features have been added since <a data-link-type="biblio" href="#biblio-css2" title="Cascading Style Sheets Level 2 Revision 1 (CSS 2.1) Specification">[CSS2]</a>: </p> <ul> <li>The <a class="property css" data-link-type="property" href="#propdef-box-sizing" id="ref-for-propdef-box-sizing⑨">box-sizing</a> property (originally defined in <a data-link-type="biblio" href="#biblio-css-ui-3" title="CSS Basic User Interface Module Level 3 (CSS3 UI)">[CSS-UI-3]</a>, then moved here). <li>The <a class="css" data-link-type="maybe" href="#valdef-width-min-content" id="ref-for-valdef-width-min-content⑦">min-content</a>, <a class="css" data-link-type="maybe" href="#valdef-width-max-content" id="ref-for-valdef-width-max-content⑥">max-content</a>, and <a class="css" data-link-type="maybe" href="#funcdef-width-fit-content" id="ref-for-funcdef-width-fit-content⑧">fit-content()</a> values of the <a data-link-type="dfn" href="#sizing-property" id="ref-for-sizing-property⑤">sizing properties</a>. <li>The <a class="css" data-link-type="maybe" href="#valdef-width-auto" id="ref-for-valdef-width-auto①⑨">auto</a> initial value of the <a class="property css" data-link-type="property" href="#propdef-min-width" id="ref-for-propdef-min-width⑧">min-width</a> and <a class="property css" data-link-type="property" href="#propdef-min-height" id="ref-for-propdef-min-height①①">min-height</a> properties (originally defined in <a data-link-type="biblio" href="#biblio-css-flexbox-1" title="CSS Flexible Box Layout Module Level 1">[CSS-FLEXBOX-1]</a>, then moved here). </ul> <h2 class="no-num heading settled" id="acknowledgments"><span class="content"> Acknowledgments</span><a class="self-link" href="#acknowledgments"></a></h2> <p>Special thanks go to L. David Baron, Aaron Gustafson, Daniel Holbert, and Mats Palmgren for their contributions to this module. </p> <h2 class="no-num heading settled" id="priv-sec"><span class="content"> Privacy and Security Considerations</span><a class="self-link" href="#priv-sec"></a></h2> <p>In order to support automatic layout, CSS sizes boxes to fit their contents. In conjunction with various <a data-link-type="biblio" href="#biblio-dom" title="DOM Standard">[DOM]</a> and <a data-link-type="biblio" href="#biblio-cssom" title="CSS Object Model (CSSOM)">[CSSOM]</a> APIs which can return the size of those boxes to script, this can expose information about those contents. However, this information is more directly and easily available by inspecting the DOM for the contents, rather than indirecting through the box’s size. Containers that can’t have their contents inspected (such as cross-origin <code><a data-link-type="element" href="https://html.spec.whatwg.org/multipage/iframe-embed-object.html#the-iframe-element" id="ref-for-the-iframe-element①">iframe</a></code>s) also do not expose sizing information to the outer page, except insofar as <a data-link-type="dfn" href="https://drafts.csswg.org/css-display-4/#replaced-element" id="ref-for-replaced-element⑦">replaced elements</a> such as images expose their natural size and/or aspect ratio.</p> </main> <h2 class="no-ref no-num heading settled" id="w3c-conformance"><span class="content"> Conformance</span><a class="self-link" href="#w3c-conformance"></a></h2> <h3 class="no-ref heading settled" id="w3c-conventions"><span class="content"> Document conventions</span><a class="self-link" href="#w3c-conventions"></a></h3> <p>Conformance requirements are expressed with a combination of descriptive assertions and RFC 2119 terminology. The key words “MUST”, “MUST NOT”, “REQUIRED”, “SHALL”, “SHALL NOT”, “SHOULD”, “SHOULD NOT”, “RECOMMENDED”, “MAY”, and “OPTIONAL” in the normative parts of this document are to be interpreted as described in RFC 2119. However, for readability, these words do not appear in all uppercase letters in this specification. </p> <p>All of the text of this specification is normative except sections explicitly marked as non-normative, examples, and notes. <a data-link-type="biblio" href="#biblio-rfc2119" title="Key words for use in RFCs to Indicate Requirement Levels">[RFC2119]</a></p> <p>Examples in this specification are introduced with the words “for example” or are set apart from the normative text with <code>class="example"</code>, like this: </p> <div class="example" id="w3c-example"> <a class="self-link" href="#w3c-example"></a> <p>This is an example of an informative example.</p> </div> <p>Informative notes begin with the word “Note” and are set apart from the normative text with <code>class="note"</code>, like this: </p> <p class="note" role="note">Note, this is an informative note.</p> <p>Advisements are normative sections styled to evoke special attention and are set apart from other normative text with <code>&lt;strong class="advisement"></code>, like this: <strong class="advisement"> UAs MUST provide an accessible alternative. </strong></p> <details class="wpt-tests-block" dir="ltr" lang="en" open> <summary>Tests</summary> <p>Tests relating to the content of this specification may be documented in “Tests” blocks like this one. Any such block is non-normative.</p> <ul class="wpt-tests-list"></ul> <hr> </details> <h3 class="no-ref heading settled" id="w3c-conformance-classes"><span class="content"> Conformance classes</span><a class="self-link" href="#w3c-conformance-classes"></a></h3> <p>Conformance to this specification is defined for three conformance classes: </p> <dl> <dt>style sheet <dd>A <a href="http://www.w3.org/TR/CSS21/conform.html#style-sheet">CSS style sheet</a>. <dt>renderer <dd>A <a href="http://www.w3.org/TR/CSS21/conform.html#user-agent">UA</a> that interprets the semantics of a style sheet and renders documents that use them. <dt>authoring tool <dd>A <a href="http://www.w3.org/TR/CSS21/conform.html#user-agent">UA</a> that writes a style sheet. </dl> <p>A style sheet is conformant to this specification if all of its statements that use syntax defined in this module are valid according to the generic CSS grammar and the individual grammars of each feature defined in this module. </p> <p>A renderer is conformant to this specification if, in addition to interpreting the style sheet as defined by the appropriate specifications, it supports all the features defined by this specification by parsing them correctly and rendering the document accordingly. However, the inability of a UA to correctly render a document due to limitations of the device does not make the UA non-conformant. (For example, a UA is not required to render color on a monochrome monitor.) </p> <p>An authoring tool is conformant to this specification if it writes style sheets that are syntactically correct according to the generic CSS grammar and the individual grammars of each feature in this module, and meet all other conformance requirements of style sheets as described in this module. </p> <h3 class="no-ref heading settled" id="w3c-partial"><span class="content"> Partial implementations</span><a class="self-link" href="#w3c-partial"></a></h3> <p>So that authors can exploit the forward-compatible parsing rules to assign fallback values, CSS renderers <strong>must</strong> treat as invalid (and <a href="http://www.w3.org/TR/CSS21/conform.html#ignore">ignore as appropriate</a>) any at-rules, properties, property values, keywords, and other syntactic constructs for which they have no usable level of support. In particular, user agents <strong>must not</strong> selectively ignore unsupported component values and honor supported values in a single multi-value property declaration: if any value is considered invalid (as unsupported values must be), CSS requires that the entire declaration be ignored.</p> <h4 class="heading settled" id="w3c-conform-future-proofing"><span class="content"> Implementations of Unstable and Proprietary Features</span><a class="self-link" href="#w3c-conform-future-proofing"></a></h4> <p>To avoid clashes with future stable CSS features, the CSSWG recommends <a href="http://www.w3.org/TR/CSS/#future-proofing">following best practices</a> for the implementation of <a href="http://www.w3.org/TR/CSS/#unstable">unstable</a> features and <a href="http://www.w3.org/TR/CSS/#proprietary-extension">proprietary extensions</a> to CSS. </p> <h3 class="no-ref heading settled" id="w3c-testing"><span class="content"> Non-experimental implementations</span><a class="self-link" href="#w3c-testing"></a></h3> <p>Once a specification reaches the Candidate Recommendation stage, non-experimental implementations are possible, and implementors should release an unprefixed implementation of any CR-level feature they can demonstrate to be correctly implemented according to spec. </p> <p>To establish and maintain the interoperability of CSS across implementations, the CSS Working Group requests that non-experimental CSS renderers submit an implementation report (and, if necessary, the testcases used for that implementation report) to the W3C before releasing an unprefixed implementation of any CSS features. Testcases submitted to W3C are subject to review and correction by the CSS Working Group. </p> <p>Further information on submitting testcases and implementation reports can be found from on the CSS Working Group’s website at <a href="http://www.w3.org/Style/CSS/Test/">http://www.w3.org/Style/CSS/Test/</a>. Questions should be directed to the <a href="http://lists.w3.org/Archives/Public/public-css-testsuite">public-css-testsuite@w3.org</a> mailing list.</p> <script src="https://www.w3.org/scripts/TR/2021/fixup.js"></script> <h2 class="no-num no-ref heading settled" id="index"><span class="content">Index</span><a class="self-link" href="#index"></a></h2> <h3 class="no-num no-ref heading settled" id="index-defined-here"><span class="content">Terms defined by this specification</span><a class="self-link" href="#index-defined-here"></a></h3> <ul class="index"> <li><a href="#valdef-width-auto">auto</a><span>, in § 3.2</span> <li><a href="#automatic-block-size">automatic block size</a><span>, in § 3.2</span> <li><a href="#automatic-inline-size">automatic inline size</a><span>, in § 3.2</span> <li><a href="#automatic-minimum-size">automatic minimum size</a><span>, in § 3.2</span> <li><a href="#automatic-size">automatic size</a><span>, in § 3.2</span> <li><a href="#available">available</a><span>, in § 2</span> <li><a href="#available">available block space</a><span>, in § 2</span> <li><a href="#available">available inline space</a><span>, in § 2</span> <li><a href="#available">available space</a><span>, in § 2</span> <li><a href="#behave-as-auto">behave as auto</a><span>, in § 3.2.1</span> <li><a href="#behave-as-auto">behaves as auto</a><span>, in § 3.2.1</span> <li><a href="#behave-as-auto">behaving as auto</a><span>, in § 3.2.1</span> <li><a href="#valdef-box-sizing-border-box">border-box</a><span>, in § 3.3</span> <li><a href="#propdef-box-sizing">box-sizing</a><span>, in § 3.3</span> <li><a href="#funcdef-width-calc-size">calc-size()</a><span>, in § 3.2</span> <li><a href="#valdef-box-sizing-content-box">content-box</a><span>, in § 3.3</span> <li><a href="#cyclic-percentage-size">cyclic percentage</a><span>, in § 5.2.1</span> <li><a href="#cyclic-percentage-size">cyclic percentage size</a><span>, in § 5.2.1</span> <li><a href="#definite">definite</a><span>, in § 2</span> <li><a href="#definite">definite size</a><span>, in § 2</span> <li><a href="#extrinsic-sizing">Extrinsic sizing</a><span>, in § 4</span> <li><a href="#fallback">fallback</a><span>, in § 2</span> <li><a href="#fallback">fallback size</a><span>, in § 2</span> <li><a href="#funcdef-width-fit-content">fit-content()</a><span>, in § 3.2</span> <li><a href="#fit-content-block-size">fit-content block size</a><span>, in § 2.1</span> <li><a href="#fit-content-inline-size">fit-content inline size</a><span>, in § 2.1</span> <li><a href="#valdef-column-width-fit-content-length-percentage">fit-content(&lt;length-percentage>)</a><span>, in § 3.4</span> <li><a href="#fit-content-size">fit-content size</a><span>, in § 2.1</span> <li> height <ul> <li><a href="#propdef-height">(property)</a><span>, in § 3.1.1</span> <li><a href="#height">definition of</a><span>, in § 3.1.1</span> </ul> <li><a href="#indefinite">indefinite</a><span>, in § 2</span> <li><a href="#indefinite">indefinite size</a><span>, in § 2</span> <li><a href="#inner-size">inner block size</a><span>, in § 2</span> <li><a href="#inner-size">inner height</a><span>, in § 2</span> <li><a href="#inner-size">inner inline size</a><span>, in § 2</span> <li><a href="#inner-size">inner size</a><span>, in § 2</span> <li><a href="#inner-size">inner width</a><span>, in § 2</span> <li><a href="#intrinsic-size">intrinsic size</a><span>, in § 2.1</span> <li><a href="#constraints">intrinsic size constraint</a><span>, in § 2.2</span> <li><a href="#intrinsic-size-contribution">intrinsic size contribution</a><span>, in § 2.2</span> <li><a href="#intrinsic-sizing">Intrinsic sizing</a><span>, in § 5</span> <li><a href="#valdef-width-length-percentage-0">&lt;length-percentage [0,∞]></a><span>, in § 3.2</span> <li> max-content <ul> <li><a href="#max-content">definition of</a><span>, in § 2.1</span> <li><a href="#valdef-column-width-max-content">value for column-width</a><span>, in § 3.4</span> <li><a href="#valdef-width-max-content">value for width, min-width, max-width, height, min-height, max-height</a><span>, in § 3.2</span> </ul> <li><a href="#max-content-block-size">max-content block size</a><span>, in § 2.1</span> <li><a href="#max-content-contribution">max-content block-size contribution</a><span>, in § 2.2</span> <li><a href="#max-content-constraint">max-content constraint</a><span>, in § 2.3</span> <li><a href="#max-content-contribution">max-content contribution</a><span>, in § 2.2</span> <li><a href="#max-content-inline-size">max-content inline size</a><span>, in § 2.1</span> <li><a href="#max-content-contribution">max-content inline-size contribution</a><span>, in § 2.2</span> <li><a href="#max-content">max-content size</a><span>, in § 2.1</span> <li><a href="#max-height">max height</a><span>, in § 3.1.3</span> <li><a href="#propdef-max-height">max-height</a><span>, in § 3.1.3</span> <li><a href="#max-height">maximum height</a><span>, in § 3.1.3</span> <li><a href="#max-width">maximum size</a><span>, in § 3.1.3</span> <li><a href="#max-width">maximum width</a><span>, in § 3.1.3</span> <li><a href="#max-width">max size</a><span>, in § 3.1.3</span> <li><a href="#max-size-properties">max size property</a><span>, in § 3.1.2</span> <li><a href="#max-width">max width</a><span>, in § 3.1.3</span> <li><a href="#propdef-max-width">max-width</a><span>, in § 3.1.3</span> <li> min-content <ul> <li><a href="#min-content">definition of</a><span>, in § 2.1</span> <li><a href="#valdef-column-width-min-content">value for column-width</a><span>, in § 3.4</span> <li><a href="#valdef-width-min-content">value for width, min-width, max-width, height, min-height, max-height</a><span>, in § 3.2</span> </ul> <li><a href="#min-content-block-size">min-content block size</a><span>, in § 2.1</span> <li><a href="#min-content-contribution">min-content block-size contribution</a><span>, in § 2.2</span> <li><a href="#min-content-constraint">min-content constraint</a><span>, in § 2.3</span> <li><a href="#min-content-contribution">min-content contribution</a><span>, in § 2.2</span> <li><a href="#min-content-inline-size">min-content inline size</a><span>, in § 2.1</span> <li><a href="#min-content-contribution">min-content inline-size contribution</a><span>, in § 2.2</span> <li><a href="#min-content">min-content size</a><span>, in § 2.1</span> <li><a href="#min-height">min height</a><span>, in § 3.1.2</span> <li><a href="#propdef-min-height">min-height</a><span>, in § 3.1.2</span> <li><a href="#min-height">minimum height</a><span>, in § 3.1.2</span> <li><a href="#min-width">minimum size</a><span>, in § 3.1.2</span> <li><a href="#min-width">minimum width</a><span>, in § 3.1.2</span> <li><a href="#min-width">min size</a><span>, in § 3.1.2</span> <li><a href="#min-size-properties">min size property</a><span>, in § 3.1.1</span> <li><a href="#min-width">min width</a><span>, in § 3.1.2</span> <li><a href="#propdef-min-width">min-width</a><span>, in § 3.1.2</span> <li><a href="#valdef-max-width-none">none</a><span>, in § 3.2</span> <li><a href="#outer-size">outer block size</a><span>, in § 2</span> <li><a href="#outer-size">outer height</a><span>, in § 2</span> <li><a href="#outer-size">outer inline size</a><span>, in § 2</span> <li><a href="#outer-size">outer size</a><span>, in § 2</span> <li><a href="#outer-size">outer width</a><span>, in § 2</span> <li><a href="#preferred-aspect-ratio">preferred aspect ratio</a><span>, in § 2.3</span> <li><a href="#height">preferred height</a><span>, in § 3.1.1</span> <li><a href="#preferred-size">preferred size</a><span>, in § 3.1.1</span> <li><a href="#preferred-size-properties">preferred size property</a><span>, in § 3.1</span> <li><a href="#width">preferred width</a><span>, in § 3.1.1</span> <li><a href="#size">size</a><span>, in § 2</span> <li><a href="#sizing-property">sizing property</a><span>, in § 3.1</span> <li><a href="#stretch-fit">stretch fit</a><span>, in § 2</span> <li><a href="#stretch-fit-block-size">stretch-fit block size</a><span>, in § 2.1</span> <li><a href="#stretch-fit-inline-size">stretch-fit inline size</a><span>, in § 2.1</span> <li><a href="#stretch-fit-size">stretch-fit size</a><span>, in § 2.1</span> <li> width <ul> <li><a href="#propdef-width">(property)</a><span>, in § 3.1.1</span> <li><a href="#width">definition of</a><span>, in § 3.1.1</span> </ul> </ul> <h3 class="no-num no-ref heading settled" id="index-defined-elsewhere"><span class="content">Terms defined by reference</span><a class="self-link" href="#index-defined-elsewhere"></a></h3> <ul class="index"> <li> <a data-link-type="biblio">[CSS-ALIGN-3]</a> defines the following terms: <ul> <li><span class="dfn-paneled" id="7e6af1ac">gutter</span> </ul> <li> <a data-link-type="biblio">[CSS-BACKGROUNDS-3]</a> defines the following terms: <ul> <li><span class="dfn-paneled" id="a9734ee4">border</span> </ul> <li> <a data-link-type="biblio">[CSS-BOX-4]</a> defines the following terms: <ul> <li><span class="dfn-paneled" id="f598742d">border box</span> <li><span class="dfn-paneled" id="46c6a718">content box</span> <li><span class="dfn-paneled" id="54aa64f0">margin</span> <li><span class="dfn-paneled" id="1ea6c25d">margin properties</span> <li><span class="dfn-paneled" id="c1b73c63">padding</span> <li><span class="dfn-paneled" id="6b7e1616">padding properties</span> </ul> <li> <a data-link-type="biblio">[CSS-CASCADE-5]</a> defines the following terms: <ul> <li><span class="dfn-paneled" id="9cd25054">computed value</span> <li><span class="dfn-paneled" id="9ea6bed2">initial value</span> </ul> <li> <a data-link-type="biblio">[CSS-CONTAIN-2]</a> defines the following terms: <ul> <li><span class="dfn-paneled" id="3fe04ff7">size containment</span> </ul> <li> <a data-link-type="biblio">[CSS-DISPLAY-3]</a> defines the following terms: <ul> <li><span class="dfn-paneled" id="5722daa9">box</span> <li><span class="dfn-paneled" id="0e9419b9">display</span> </ul> <li> <a data-link-type="biblio">[CSS-DISPLAY-4]</a> defines the following terms: <ul> <li><span class="dfn-paneled" id="8e39589a">block box</span> <li><span class="dfn-paneled" id="9f3d4f17">block container</span> <li><span class="dfn-paneled" id="ea663a43">containing block</span> <li><span class="dfn-paneled" id="09cd65e4">display type</span> <li><span class="dfn-paneled" id="0bc73d68">formatting context</span> <li><span class="dfn-paneled" id="8d0ede2c">initial containing block</span> <li><span class="dfn-paneled" id="6b6ef55d">inline</span> <li><span class="dfn-paneled" id="083ffe5f">inline box</span> <li><span class="dfn-paneled" id="f952f01b">non-replaced</span> <li><span class="dfn-paneled" id="94f59a47">replaced</span> <li><span class="dfn-paneled" id="a8485ff4">replaced element</span> <li><span class="dfn-paneled" id="ac6ecea0">text sequence</span> </ul> <li> <a data-link-type="biblio">[CSS-FLEXBOX-1]</a> defines the following terms: <ul> <li><span class="dfn-paneled" id="66c521a7">flex item</span> <li><span class="dfn-paneled" id="73a98e20">flex layout</span> <li><span class="dfn-paneled" id="7de09c13">flex-basis</span> </ul> <li> <a data-link-type="biblio">[CSS-GRID-2]</a> defines the following terms: <ul> <li><span class="dfn-paneled" id="1044d688">grid item</span> </ul> <li> <a data-link-type="biblio">[CSS-IMAGES-3]</a> defines the following terms: <ul> <li><span class="dfn-paneled" id="23012643">natural aspect ratio</span> <li><span class="dfn-paneled" id="d3936525">natural dimension</span> <li><span class="dfn-paneled" id="ed3eb665">natural size</span> </ul> <li> <a data-link-type="biblio">[CSS-LOGICAL-1]</a> defines the following terms: <ul> <li><span class="dfn-paneled" id="f0c46389">block-size</span> <li><span class="dfn-paneled" id="c914acd1">max-block-size</span> </ul> <li> <a data-link-type="biblio">[CSS-MULTICOL-2]</a> defines the following terms: <ul> <li><span class="dfn-paneled" id="f8cff8d7">column-width</span> </ul> <li> <a data-link-type="biblio">[CSS-PAGE-3]</a> defines the following terms: <ul> <li><span class="dfn-paneled" id="5ee7eb9e">@page</span> </ul> <li> <a data-link-type="biblio">[CSS-SIZING-4]</a> defines the following terms: <ul> <li><span class="dfn-paneled" id="9acf31c7">auto</span> <li><span class="dfn-paneled" id="426739b5">contain</span> <li><span class="dfn-paneled" id="9620c79b">contain-intrinsic-size</span> <li><span class="dfn-paneled" id="799c2725">fit-content</span> <li><span class="dfn-paneled" id="13cd11dd">stretch</span> </ul> <li> <a data-link-type="biblio">[CSS-TEXT-4]</a> defines the following terms: <ul> <li><span class="dfn-paneled" id="0e74a72c">soft wrap opportunity</span> </ul> <li> <a data-link-type="biblio">[CSS-VALUES-4]</a> defines the following terms: <ul> <li><span class="dfn-paneled" id="18222566">&lt;length-percentage></span> <li><span class="dfn-paneled" id="fb030e6c">&lt;length></span> <li><span class="dfn-paneled" id="15f5b381">&lt;percentage></span> <li><span class="dfn-paneled" id="f2401ef5">contain a percentage</span> <li><span class="dfn-paneled" id="358fd6ff">CSS-wide keywords</span> <li><span class="dfn-paneled" id="6ec67710">|</span> </ul> <li> <a data-link-type="biblio">[CSS-WRITING-MODES-4]</a> defines the following terms: <ul> <li><span class="dfn-paneled" id="e1ab41b7">block axis</span> <li><span class="dfn-paneled" id="190183bb">block size</span> <li><span class="dfn-paneled" id="32995ff0">block-axis</span> <li><span class="dfn-paneled" id="5eff29c1">flow-relative</span> <li><span class="dfn-paneled" id="43667deb">inline axis</span> <li><span class="dfn-paneled" id="37f0daea">inline size</span> <li><span class="dfn-paneled" id="d9c76793">physical</span> <li><span class="dfn-paneled" id="a73617e0">writing mode</span> </ul> <li> <a data-link-type="biblio">[CSSOM]</a> defines the following terms: <ul> <li><span class="dfn-paneled" id="b203675a">getComputedStyle(elt)</span> <li><span class="dfn-paneled" id="4fe61159">resolved value</span> </ul> <li> <a data-link-type="biblio">[HTML]</a> defines the following terms: <ul> <li><span class="dfn-paneled" id="bfff6250">button</span> <li><span class="dfn-paneled" id="87fcd40c">iframe</span> <li><span class="dfn-paneled" id="d7d642a2">input</span> <li><span class="dfn-paneled" id="83d1e90e">marquee</span> <li><span class="dfn-paneled" id="b23654ab">meter</span> <li><span class="dfn-paneled" id="b90b2ad5">progress</span> <li><span class="dfn-paneled" id="b3bf6f52">raw value</span> <li><span class="dfn-paneled" id="85188fb3">select</span> <li><span class="dfn-paneled" id="fc736137">textarea</span> <li><span class="dfn-paneled" id="66aee777">type</span> </ul> </ul> <h2 class="no-num no-ref heading settled" id="references"><span class="content">References</span><a class="self-link" href="#references"></a></h2> <h3 class="no-num no-ref heading settled" id="normative"><span class="content">Normative References</span><a class="self-link" href="#normative"></a></h3> <dl> <dt id="biblio-css-align-3">[CSS-ALIGN-3] <dd>Elika Etemad; Tab Atkins Jr.. <a href="https://drafts.csswg.org/css-align/"><cite>CSS Box Alignment Module Level 3</cite></a>. URL: <a href="https://drafts.csswg.org/css-align/">https://drafts.csswg.org/css-align/</a> <dt id="biblio-css-box-4">[CSS-BOX-4] <dd>Elika Etemad. <a href="https://drafts.csswg.org/css-box-4/"><cite>CSS Box Model Module Level 4</cite></a>. URL: <a href="https://drafts.csswg.org/css-box-4/">https://drafts.csswg.org/css-box-4/</a> <dt id="biblio-css-cascade-5">[CSS-CASCADE-5] <dd>Elika Etemad; Miriam Suzanne; Tab Atkins Jr.. <a href="https://drafts.csswg.org/css-cascade-5/"><cite>CSS Cascading and Inheritance Level 5</cite></a>. URL: <a href="https://drafts.csswg.org/css-cascade-5/">https://drafts.csswg.org/css-cascade-5/</a> <dt id="biblio-css-display-3">[CSS-DISPLAY-3] <dd>Elika Etemad; Tab Atkins Jr.. <a href="https://drafts.csswg.org/css-display/"><cite>CSS Display Module Level 3</cite></a>. URL: <a href="https://drafts.csswg.org/css-display/">https://drafts.csswg.org/css-display/</a> <dt id="biblio-css-display-4">[CSS-DISPLAY-4] <dd>Elika Etemad; Tab Atkins Jr.. <a href="https://drafts.csswg.org/css-display/"><cite>CSS Display Module Level 4</cite></a>. URL: <a href="https://drafts.csswg.org/css-display/">https://drafts.csswg.org/css-display/</a> <dt id="biblio-css-flexbox-1">[CSS-FLEXBOX-1] <dd>Tab Atkins Jr.; et al. <a href="https://drafts.csswg.org/css-flexbox-1/"><cite>CSS Flexible Box Layout Module Level 1</cite></a>. URL: <a href="https://drafts.csswg.org/css-flexbox-1/">https://drafts.csswg.org/css-flexbox-1/</a> <dt id="biblio-css-images-3">[CSS-IMAGES-3] <dd>Tab Atkins Jr.; Elika Etemad; Lea Verou. <a href="https://drafts.csswg.org/css-images-3/"><cite>CSS Images Module Level 3</cite></a>. URL: <a href="https://drafts.csswg.org/css-images-3/">https://drafts.csswg.org/css-images-3/</a> <dt id="biblio-css-logical-1">[CSS-LOGICAL-1] <dd>Rossen Atanassov; Elika Etemad. <a href="https://drafts.csswg.org/css-logical-1/"><cite>CSS Logical Properties and Values Level 1</cite></a>. URL: <a href="https://drafts.csswg.org/css-logical-1/">https://drafts.csswg.org/css-logical-1/</a> <dt id="biblio-css-multicol-2">[CSS-MULTICOL-2] <dd>Florian Rivoal; Rachel Andrew. <a href="https://drafts.csswg.org/css-multicol-2/"><cite>CSS Multi-column Layout Module Level 2</cite></a>. URL: <a href="https://drafts.csswg.org/css-multicol-2/">https://drafts.csswg.org/css-multicol-2/</a> <dt id="biblio-css-page-3">[CSS-PAGE-3] <dd>Elika Etemad. <a href="https://drafts.csswg.org/css-page-3/"><cite>CSS Paged Media Module Level 3</cite></a>. URL: <a href="https://drafts.csswg.org/css-page-3/">https://drafts.csswg.org/css-page-3/</a> <dt id="biblio-css-sizing-4">[CSS-SIZING-4] <dd>Tab Atkins Jr.; Elika Etemad; Jen Simmons. <a href="https://drafts.csswg.org/css-sizing-4/"><cite>CSS Box Sizing Module Level 4</cite></a>. URL: <a href="https://drafts.csswg.org/css-sizing-4/">https://drafts.csswg.org/css-sizing-4/</a> <dt id="biblio-css-text-4">[CSS-TEXT-4] <dd>Elika Etemad; et al. <a href="https://drafts.csswg.org/css-text-4/"><cite>CSS Text Module Level 4</cite></a>. URL: <a href="https://drafts.csswg.org/css-text-4/">https://drafts.csswg.org/css-text-4/</a> <dt id="biblio-css-ui-3">[CSS-UI-3] <dd>Tantek Çelik; Florian Rivoal. <a href="https://drafts.csswg.org/css-ui-3/"><cite>CSS Basic User Interface Module Level 3 (CSS3 UI)</cite></a>. URL: <a href="https://drafts.csswg.org/css-ui-3/">https://drafts.csswg.org/css-ui-3/</a> <dt id="biblio-css-values-3">[CSS-VALUES-3] <dd>Tab Atkins Jr.; Elika Etemad. <a href="https://drafts.csswg.org/css-values-3/"><cite>CSS Values and Units Module Level 3</cite></a>. URL: <a href="https://drafts.csswg.org/css-values-3/">https://drafts.csswg.org/css-values-3/</a> <dt id="biblio-css-values-4">[CSS-VALUES-4] <dd>Tab Atkins Jr.; Elika Etemad. <a href="https://drafts.csswg.org/css-values-4/"><cite>CSS Values and Units Module Level 4</cite></a>. URL: <a href="https://drafts.csswg.org/css-values-4/">https://drafts.csswg.org/css-values-4/</a> <dt id="biblio-css-writing-modes-3">[CSS-WRITING-MODES-3] <dd>Elika Etemad; Koji Ishii. <a href="https://drafts.csswg.org/css-writing-modes-3/"><cite>CSS Writing Modes Level 3</cite></a>. URL: <a href="https://drafts.csswg.org/css-writing-modes-3/">https://drafts.csswg.org/css-writing-modes-3/</a> <dt id="biblio-css-writing-modes-4">[CSS-WRITING-MODES-4] <dd>Elika Etemad; Koji Ishii. <a href="https://drafts.csswg.org/css-writing-modes-4/"><cite>CSS Writing Modes Level 4</cite></a>. URL: <a href="https://drafts.csswg.org/css-writing-modes-4/">https://drafts.csswg.org/css-writing-modes-4/</a> <dt id="biblio-css2">[CSS2] <dd>Bert Bos; et al. <a href="https://drafts.csswg.org/css2/"><cite>Cascading Style Sheets Level 2 Revision 1 (CSS 2.1) Specification</cite></a>. URL: <a href="https://drafts.csswg.org/css2/">https://drafts.csswg.org/css2/</a> <dt id="biblio-css3col">[CSS3COL] <dd>Florian Rivoal; Rachel Andrew. <a href="https://drafts.csswg.org/css-multicol/"><cite>CSS Multi-column Layout Module Level 1</cite></a>. URL: <a href="https://drafts.csswg.org/css-multicol/">https://drafts.csswg.org/css-multicol/</a> <dt id="biblio-cssom">[CSSOM] <dd>Daniel Glazman; Emilio Cobos Álvarez. <a href="https://drafts.csswg.org/cssom/"><cite>CSS Object Model (CSSOM)</cite></a>. URL: <a href="https://drafts.csswg.org/cssom/">https://drafts.csswg.org/cssom/</a> <dt id="biblio-html">[HTML] <dd>Anne van Kesteren; et al. <a href="https://html.spec.whatwg.org/multipage/"><cite>HTML Standard</cite></a>. Living Standard. URL: <a href="https://html.spec.whatwg.org/multipage/">https://html.spec.whatwg.org/multipage/</a> <dt id="biblio-rfc2119">[RFC2119] <dd>S. Bradner. <a href="https://datatracker.ietf.org/doc/html/rfc2119"><cite>Key words for use in RFCs to Indicate Requirement Levels</cite></a>. March 1997. Best Current Practice. URL: <a href="https://datatracker.ietf.org/doc/html/rfc2119">https://datatracker.ietf.org/doc/html/rfc2119</a> </dl> <h3 class="no-num no-ref heading settled" id="informative"><span class="content">Informative References</span><a class="self-link" href="#informative"></a></h3> <dl> <dt id="biblio-css-backgrounds-3">[CSS-BACKGROUNDS-3] <dd>Elika Etemad; Brad Kemper. <a href="https://drafts.csswg.org/css-backgrounds/"><cite>CSS Backgrounds and Borders Module Level 3</cite></a>. URL: <a href="https://drafts.csswg.org/css-backgrounds/">https://drafts.csswg.org/css-backgrounds/</a> <dt id="biblio-css-contain-2">[CSS-CONTAIN-2] <dd>Tab Atkins Jr.; Florian Rivoal; Vladimir Levin. <a href="https://drafts.csswg.org/css-contain-2/"><cite>CSS Containment Module Level 2</cite></a>. URL: <a href="https://drafts.csswg.org/css-contain-2/">https://drafts.csswg.org/css-contain-2/</a> <dt id="biblio-css-grid-2">[CSS-GRID-2] <dd>Tab Atkins Jr.; Elika Etemad; Rossen Atanassov. <a href="https://drafts.csswg.org/css-grid-2/"><cite>CSS Grid Layout Module Level 2</cite></a>. URL: <a href="https://drafts.csswg.org/css-grid-2/">https://drafts.csswg.org/css-grid-2/</a> <dt id="biblio-dom">[DOM] <dd>Anne van Kesteren. <a href="https://dom.spec.whatwg.org/"><cite>DOM Standard</cite></a>. Living Standard. URL: <a href="https://dom.spec.whatwg.org/">https://dom.spec.whatwg.org/</a> </dl> <h2 class="no-num no-ref heading settled" id="property-index"><span class="content">Property Index</span><a class="self-link" href="#property-index"></a></h2> <div class="big-element-wrapper"> <table class="index"> <thead> <tr> <th scope="col">Name <th scope="col">Value <th scope="col">Initial <th scope="col">Applies to <th scope="col">Inh. <th scope="col">%ages <th scope="col">Anim­ation type <th scope="col">Canonical order <th scope="col">Com­puted value <th scope="col">Logical property group <tbody> <tr> <th scope="row"><a class="css" data-link-type="property" href="#propdef-box-sizing" id="ref-for-propdef-box-sizing①⓪">box-sizing</a> <td>content-box | border-box <td>content-box <td>all elements that accept width or height <td>no <td>N/A <td>discrete <td>per grammar <td>specified keyword <td> <tr> <th scope="row"><a class="css" data-link-type="property" href="#propdef-height" id="ref-for-propdef-height②⑤">height</a> <td>auto | &lt;length-percentage [0,∞]> | min-content | max-content | fit-content(&lt;length-percentage [0,∞]>) | &lt;calc-size()> <td>auto <td>all elements except non-replaced inlines <td>no <td>relative to width/height of containing block <td>by computed value type, recursing into fit-content() <td>per grammar <td>as specified, with &lt;length-percentage> values computed <td>size <tr> <th scope="row"><a class="css" data-link-type="property" href="#propdef-max-height" id="ref-for-propdef-max-height⑧">max-height</a> <td>none | &lt;length-percentage [0,∞]> | min-content | max-content | fit-content(&lt;length-percentage [0,∞]>) | &lt;calc-size()> <td>none <td>all elements that accept width or height <td>no <td>relative to width/height of containing block <td>by computed value, recursing into fit-content() <td>per grammar <td>as specified, with &lt;length-percentage> values computed <td>max-size <tr> <th scope="row"><a class="css" data-link-type="property" href="#propdef-max-width" id="ref-for-propdef-max-width⑦">max-width</a> <td>none | &lt;length-percentage [0,∞]> | min-content | max-content | fit-content(&lt;length-percentage [0,∞]>) | &lt;calc-size()> <td>none <td>all elements that accept width or height <td>no <td>relative to width/height of containing block <td>by computed value, recursing into fit-content() <td>per grammar <td>as specified, with &lt;length-percentage> values computed <td>max-size <tr> <th scope="row"><a class="css" data-link-type="property" href="#propdef-min-height" id="ref-for-propdef-min-height①②">min-height</a> <td>auto | &lt;length-percentage [0,∞]> | min-content | max-content | fit-content(&lt;length-percentage [0,∞]>) | &lt;calc-size()> <td>auto <td>all elements that accept width or height <td>no <td>relative to width/height of containing block <td>by computed value, recursing into fit-content() <td>per grammar <td>as specified, with &lt;length-percentage> values computed <td>min-size <tr> <th scope="row"><a class="css" data-link-type="property" href="#propdef-min-width" id="ref-for-propdef-min-width⑨">min-width</a> <td>auto | &lt;length-percentage [0,∞]> | min-content | max-content | fit-content(&lt;length-percentage [0,∞]>) | &lt;calc-size()> <td>auto <td>all elements that accept width or height <td>no <td>relative to width/height of containing block <td>by computed value, recursing into fit-content() <td>per grammar <td>as specified, with &lt;length-percentage> values computed <td>min-size <tr> <th scope="row"><a class="css" data-link-type="property" href="#propdef-width" id="ref-for-propdef-width②⑥">width</a> <td>auto | &lt;length-percentage [0,∞]> | min-content | max-content | fit-content(&lt;length-percentage [0,∞]>) | &lt;calc-size()> <td>auto <td>all elements except non-replaced inlines <td>no <td>relative to width/height of containing block <td>by computed value type, recursing into fit-content() <td>per grammar <td>as specified, with &lt;length-percentage> values computed <td>size </table> </div> <h2 class="no-num no-ref heading settled" id="issues-index"><span class="content">Issues Index</span><a class="self-link" href="#issues-index"></a></h2> <div style="counter-reset:issue"> <div class="issue"> This spec needs illustrations! See <a href="https://github.com/w3c/csswg-drafts/issues/1938">issue</a>. <a class="issue-return" href="#issue-664b2cc3" title="Jump to section">↵</a></div> <div class="issue"> We would like to define shorthands for each pair of sizing properties (e.g. <a class="property css" data-link-type="property" href="#propdef-width">width</a> and <a class="property css" data-link-type="property" href="#propdef-height">height</a>) but there is a naming conflict with the <a class="css" data-link-type="maybe" href="https://drafts.csswg.org/css-page-3/#at-ruledef-page">@page</a> <a class="property css" data-link-type="property">size</a> descriptor <a data-link-type="biblio" href="#biblio-css-page-3" title="CSS Paged Media Module Level 3">[CSS-PAGE-3]</a>, so this has been deferred to Level 4. Suggestions on how to resolve this problem are welcome, see <a href="https://github.com/w3c/csswg-drafts/issues/820">discussion</a>. <a class="issue-return" href="#issue-6eb2c542" title="Jump to section">↵</a></div> <div class="issue"> Replace this section with references to the new term <a data-link-type="dfn" href="#automatic-size">automatic size</a>. <a class="issue-return" href="#issue-6215c343" title="Jump to section">↵</a></div> <div class="issue"> Should we resolve transferred percentages against their containing block instead of zero before transferring them? See <a href="https://github.com/w3c/csswg-drafts/issues/6341">discussion</a>. <a class="issue-return" href="#issue-1b92b23f" title="Jump to section">↵</a></div> <div class="issue"> Letting percentages still resolve against a definite <a class="property css" data-link-type="property" href="#propdef-height">height</a> when the min-height is intrinsic is an open issue. (CSS2 has a general statement about "height depending on contents", which this technically is, even though CSS2 didn’t have content-dependent keywords for <a class="property css" data-link-type="property" href="#propdef-min-height">min-height</a>. Since this is new, we think we could have this different behavior.) <a class="issue-return" href="#issue-9b3707fe" title="Jump to section">↵</a></div> <div class="issue"> Tracking web-compat &amp; implementation progress of applying this to max-width/height in <a href="https://github.com/w3c/csswg-drafts/issues/6348">Issue 6348</a>. <a href="https://github.com/w3c/csswg-drafts/issues/6348">[Issue #6348]</a> <a class="issue-return" href="#issue-d999780f" title="Jump to section">↵</a></div> </div> <details class="mdn-anno unpositioned" data-anno-for="box-sizing"> <summary><b class="all-engines-flag" title="This feature is in all current engines.">✔</b><span>MDN</span></summary> <div class="feature"> <p><a href="https://developer.mozilla.org/en-US/docs/Web/CSS/box-sizing" title="The box-sizing CSS property sets how the total width and height of an element is calculated.">box-sizing</a></p> <p class="all-engines-text">In all current engines.</p> <div class="support"> <span class="firefox yes"><span>Firefox</span><span>29+</span></span><span class="safari yes"><span>Safari</span><span>5.1+</span></span><span class="chrome yes"><span>Chrome</span><span>10+</span></span> <hr> <span class="opera yes"><span>Opera</span><span>7+</span></span><span class="edge_blink yes"><span>Edge</span><span>79+</span></span> <hr> <span class="edge yes"><span>Edge (Legacy)</span><span>12+</span></span><span class="ie yes"><span>IE</span><span>8+</span></span> <hr> <span class="firefox_android no"><span>Firefox for Android</span><span>?</span></span><span class="safari_ios yes"><span>iOS Safari</span><span>6+</span></span><span class="chrome_android no"><span>Chrome for Android</span><span>?</span></span><span class="webview_android yes"><span>Android WebView</span><span>4+</span></span><span class="samsunginternet_android no"><span>Samsung Internet</span><span>?</span></span><span class="opera_android no"><span>Opera Mobile</span><span>?</span></span> </div> </div> </details> <details class="mdn-anno unpositioned" data-anno-for="column-sizing"> <summary><b class="all-engines-flag" title="This feature is in all current engines.">✔</b><span>MDN</span></summary> <div class="feature"> <p><a href="https://developer.mozilla.org/en-US/docs/Web/CSS/column-width" title="The column-width CSS property sets the ideal column width in a multi-column layout. The container will have as many columns as can fit without any of them having a width less than the column-width value. If the width of the container is narrower than the specified value, the single column&apos;s width will be smaller than the declared column width.">column-width</a></p> <p class="all-engines-text">In all current engines.</p> <div class="support"> <span class="firefox yes"><span>Firefox</span><span>50+</span></span><span class="safari yes"><span>Safari</span><span>9+</span></span><span class="chrome yes"><span>Chrome</span><span>50+</span></span> <hr> <span class="opera yes"><span>Opera</span><span>11.1+</span></span><span class="edge_blink yes"><span>Edge</span><span>79+</span></span> <hr> <span class="edge yes"><span>Edge (Legacy)</span><span>12+</span></span><span class="ie yes"><span>IE</span><span>10+</span></span> <hr> <span class="firefox_android yes"><span>Firefox for Android</span><span>50+</span></span><span class="safari_ios yes"><span>iOS Safari</span><span>9+</span></span><span class="chrome_android no"><span>Chrome for Android</span><span>?</span></span><span class="webview_android yes"><span>Android WebView</span><span>50+</span></span><span class="samsunginternet_android no"><span>Samsung Internet</span><span>?</span></span><span class="opera_android yes"><span>Opera Mobile</span><span>11.1+</span></span> </div> </div> </details> <details class="mdn-anno unpositioned" data-anno-for="preferred-size-properties"> <summary><b class="all-engines-flag" title="This feature is in all current engines.">✔</b><span>MDN</span></summary> <div class="feature"> <p><a href="https://developer.mozilla.org/en-US/docs/Web/CSS/height" title="The height CSS property specifies the height of an element. By default, the property defines the height of the content area. If box-sizing is set to border-box, however, it instead determines the height of the border area.">height</a></p> <p class="all-engines-text">In all current engines.</p> <div class="support"> <span class="firefox yes"><span>Firefox</span><span>1+</span></span><span class="safari yes"><span>Safari</span><span>1+</span></span><span class="chrome yes"><span>Chrome</span><span>1+</span></span> <hr> <span class="opera yes"><span>Opera</span><span>7+</span></span><span class="edge_blink yes"><span>Edge</span><span>79+</span></span> <hr> <span class="edge yes"><span>Edge (Legacy)</span><span>12+</span></span><span class="ie yes"><span>IE</span><span>4+</span></span> <hr> <span class="firefox_android no"><span>Firefox for Android</span><span>?</span></span><span class="safari_ios no"><span>iOS Safari</span><span>?</span></span><span class="chrome_android no"><span>Chrome for Android</span><span>?</span></span><span class="webview_android no"><span>Android WebView</span><span>?</span></span><span class="samsunginternet_android no"><span>Samsung Internet</span><span>?</span></span><span class="opera_android yes"><span>Opera Mobile</span><span>10.1+</span></span> </div> </div> </details> <details class="mdn-anno unpositioned" data-anno-for="width-height-keywords"> <summary><b class="all-engines-flag" title="This feature is in all current engines.">✔</b><span>MDN</span></summary> <div class="feature"> <p><a href="https://developer.mozilla.org/en-US/docs/Web/CSS/min-height" title="The min-height CSS property sets the minimum height of an element. It prevents the used value of the height property from becoming smaller than the value specified for min-height.">min-height</a></p> <p class="all-engines-text">In all current engines.</p> <div class="support"> <span class="firefox yes"><span>Firefox</span><span>3+</span></span><span class="safari yes"><span>Safari</span><span>1.3+</span></span><span class="chrome yes"><span>Chrome</span><span>1+</span></span> <hr> <span class="opera yes"><span>Opera</span><span>4+</span></span><span class="edge_blink yes"><span>Edge</span><span>79+</span></span> <hr> <span class="edge yes"><span>Edge (Legacy)</span><span>12+</span></span><span class="ie yes"><span>IE</span><span>7+</span></span> <hr> <span class="firefox_android no"><span>Firefox for Android</span><span>?</span></span><span class="safari_ios no"><span>iOS Safari</span><span>?</span></span><span class="chrome_android no"><span>Chrome for Android</span><span>?</span></span><span class="webview_android no"><span>Android WebView</span><span>?</span></span><span class="samsunginternet_android no"><span>Samsung Internet</span><span>?</span></span><span class="opera_android no"><span>Opera Mobile</span><span>?</span></span> </div> </div> </details> <details class="mdn-anno unpositioned" data-anno-for="min-size-properties"> <summary><b class="all-engines-flag" title="This feature is in all current engines.">✔</b><span>MDN</span></summary> <div class="feature"> <p><a href="https://developer.mozilla.org/en-US/docs/Web/CSS/min-width" title="The min-width CSS property sets the minimum width of an element. It prevents the used value of the width property from becoming smaller than the value specified for min-width.">min-width</a></p> <p class="all-engines-text">In all current engines.</p> <div class="support"> <span class="firefox yes"><span>Firefox</span><span>1+</span></span><span class="safari yes"><span>Safari</span><span>1+</span></span><span class="chrome yes"><span>Chrome</span><span>1+</span></span> <hr> <span class="opera yes"><span>Opera</span><span>4+</span></span><span class="edge_blink yes"><span>Edge</span><span>79+</span></span> <hr> <span class="edge yes"><span>Edge (Legacy)</span><span>12+</span></span><span class="ie yes"><span>IE</span><span>7+</span></span> <hr> <span class="firefox_android no"><span>Firefox for Android</span><span>?</span></span><span class="safari_ios no"><span>iOS Safari</span><span>?</span></span><span class="chrome_android no"><span>Chrome for Android</span><span>?</span></span><span class="webview_android no"><span>Android WebView</span><span>?</span></span><span class="samsunginternet_android no"><span>Samsung Internet</span><span>?</span></span><span class="opera_android yes"><span>Opera Mobile</span><span>10.1+</span></span> </div> </div> </details> <details class="caniuse-status unpositioned" data-anno-for="box-sizing" data-deco> <summary>CanIUse</summary> <p class="support"><b>Support:</b><span class="android yes"><span>Android Browser</span><span>4+</span></span><span class="baidu yes"><span>Baidu Browser</span><span>13.52+</span></span><span class="bb yes"><span>Blackberry Browser</span><span>10+</span></span><span class="chrome yes"><span>Chrome</span><span>10+</span></span><span class="and_chr yes"><span>Chrome for Android</span><span>132+</span></span><span class="edge yes"><span>Edge</span><span>12+</span></span><span class="firefox yes"><span>Firefox</span><span>29+</span></span><span class="and_ff yes"><span>Firefox for Android</span><span>132+</span></span><span class="ie yes"><span>IE</span><span>8+</span></span><span class="ie_mob yes"><span>IE Mobile</span><span>10+</span></span><span class="kaios yes"><span>KaiOS Browser</span><span>2.5+</span></span><span class="opera yes"><span>Opera</span><span>9.5+</span></span><span class="op_mini yes"><span>Opera Mini</span><span>All</span></span><span class="op_mob yes"><span>Opera Mobile</span><span>10+</span></span><span class="and_qq yes"><span>QQ Browser</span><span>14.9+</span></span><span class="safari yes"><span>Safari</span><span>5.1+</span></span><span class="ios_saf yes"><span>Safari on iOS</span><span>5.0+</span></span><span class="samsung yes"><span>Samsung Internet</span><span>4+</span></span><span class="and_uc yes"><span>UC Browser for Android</span><span>15.5+</span></span></p> <p class="caniuse">Source: <a href="https://caniuse.com/#feat=css3-boxsizing">caniuse.com</a> as of 2025-02-16</p> </details> <script>/* Boilerplate: script-dom-helper */ "use strict"; function query(sel) { return document.querySelector(sel); } function queryAll(sel) { return [...document.querySelectorAll(sel)]; } function iter(obj) { if(!obj) return []; var it = obj[Symbol.iterator]; if(it) return it; return Object.entries(obj); } function mk(tagname, attrs, ...children) { const el = document.createElement(tagname); for(const [k,v] of iter(attrs)) { if(k.slice(0,3) == "_on") { const eventName = k.slice(3); el.addEventListener(eventName, v); } else if(k[0] == "_") { // property, not attribute el[k.slice(1)] = v; } else { if(v === false || v == null) { continue; } else if(v === true) { el.setAttribute(k, ""); continue; } else { el.setAttribute(k, v); } } } append(el, children); return el; } /* Create shortcuts for every known HTML element */ [ "a", "abbr", "acronym", "address", "applet", "area", "article", "aside", "audio", "b", "base", "basefont", "bdo", "big", "blockquote", "body", "br", "button", "canvas", "caption", "center", "cite", "code", "col", "colgroup", "datalist", "dd", "del", "details", "dfn", "dialog", "div", "dl", "dt", "em", "embed", "fieldset", "figcaption", "figure", "font", "footer", "form", "frame", "frameset", "head", "header", "h1", "h2", "h3", "h4", "h5", "h6", "hr", "html", "i", "iframe", "img", "input", "ins", "kbd", "label", "legend", "li", "link", "main", "map", "mark", "meta", "meter", "nav", "nobr", "noscript", "object", "ol", "optgroup", "option", "output", "p", "param", "pre", "progress", "q", "s", "samp", "script", "section", "select", "small", "source", "span", "strike", "strong", "style", "sub", "summary", "sup", "table", "tbody", "td", "template", "textarea", "tfoot", "th", "thead", "time", "title", "tr", "u", "ul", "var", "video", "wbr", "xmp", ].forEach(tagname=>{ mk[tagname] = (...args) => mk(tagname, ...args); }); function* nodesFromChildList(children) { for(const child of children.flat(Infinity)) { if(child instanceof Node) { yield child; } else { yield new Text(child); } } } function append(el, ...children) { for(const child of nodesFromChildList(children)) { if(el instanceof Node) el.appendChild(child); else el.push(child); } return el; } function insertAfter(el, ...children) { for(const child of nodesFromChildList(children)) { el.parentNode.insertBefore(child, el.nextSibling); } return el; } function clearContents(el) { el.innerHTML = ""; return el; } function parseHTML(markup) { if(markup.toLowerCase().trim().indexOf('<!doctype') === 0) { const doc = document.implementation.createHTMLDocument(""); doc.documentElement.innerHTML = markup; return doc; } else { const el = mk.template({}); el.innerHTML = markup; return el.content; } }</script> <script>/* Boilerplate: script-dfn-panel */ "use strict"; { let dfnPanelData = { "083ffe5f": {"dfnID":"083ffe5f","dfnText":"inline box","external":true,"refSections":[{"refs":[{"id":"ref-for-inline-box"}],"title":"2.1. \nAuto Box Sizes"}],"url":"https://drafts.csswg.org/css-display-4/#inline-box"}, "09cd65e4": {"dfnID":"09cd65e4","dfnText":"display type","external":true,"refSections":[{"refs":[{"id":"ref-for-display-type"}],"title":"3.2. \nSizing Values: the <length-percentage [0,\u221e]>, auto | none, min-content, max-content, and fit-content() values"}],"url":"https://drafts.csswg.org/css-display-4/#display-type"}, "0bc73d68": {"dfnID":"0bc73d68","dfnText":"formatting context","external":true,"refSections":[{"refs":[{"id":"ref-for-formatting-context"}],"title":"3.2.2. \nContaining or Excluding Floats"}],"url":"https://drafts.csswg.org/css-display-4/#formatting-context"}, "0e74a72c": {"dfnID":"0e74a72c","dfnText":"soft wrap opportunity","external":true,"refSections":[{"refs":[{"id":"ref-for-soft-wrap-opportunity"}],"title":"5.1. \nIntrinsic Sizes"}],"url":"https://drafts.csswg.org/css-text-4/#soft-wrap-opportunity"}, "0e9419b9": {"dfnID":"0e9419b9","dfnText":"display","external":true,"refSections":[{"refs":[{"id":"ref-for-propdef-display"}],"title":"3.2.2. \nContaining or Excluding Floats"}],"url":"https://drafts.csswg.org/css-display-3/#propdef-display"}, "1044d688": {"dfnID":"1044d688","dfnText":"grid item","external":true,"refSections":[{"refs":[{"id":"ref-for-grid-item"}],"title":"5.2.1. \nIntrinsic Contributions of Percentage-Sized Boxes"}],"url":"https://drafts.csswg.org/css-grid-2/#grid-item"}, "13cd11dd": {"dfnID":"13cd11dd","dfnText":"stretch","external":true,"refSections":[{"refs":[{"id":"ref-for-valdef-width-stretch"},{"id":"ref-for-valdef-width-stretch\u2460"}],"title":"3.2. \nSizing Values: the <length-percentage [0,\u221e]>, auto | none, min-content, max-content, and fit-content() values"},{"refs":[{"id":"ref-for-valdef-width-stretch\u2461"}],"title":"\nRecent Changes"}],"url":"https://drafts.csswg.org/css-sizing-4/#valdef-width-stretch"}, "15f5b381": {"dfnID":"15f5b381","dfnText":"<percentage>","external":true,"refSections":[{"refs":[{"id":"ref-for-percentage-value"}],"title":"2. \nTerminology"},{"refs":[{"id":"ref-for-percentage-value\u2460"}],"title":"3.2. \nSizing Values: the <length-percentage [0,\u221e]>, auto | none, min-content, max-content, and fit-content() values"},{"refs":[{"id":"ref-for-percentage-value\u2461"}],"title":"3.3. \nBox Edges for Sizing: the box-sizing property"}],"url":"https://drafts.csswg.org/css-values-4/#percentage-value"}, "18222566": {"dfnID":"18222566","dfnText":"<length-percentage>","external":true,"refSections":[{"refs":[{"id":"ref-for-typedef-length-percentage"},{"id":"ref-for-typedef-length-percentage\u2460"},{"id":"ref-for-typedef-length-percentage\u2461"}],"title":"3.1.1. \nPreferred Size Properties: the width and height properties"},{"refs":[{"id":"ref-for-typedef-length-percentage\u2462"},{"id":"ref-for-typedef-length-percentage\u2463"},{"id":"ref-for-typedef-length-percentage\u2464"}],"title":"3.1.2. \nMinimum Size Properties: the min-width and min-height properties"},{"refs":[{"id":"ref-for-typedef-length-percentage\u2465"},{"id":"ref-for-typedef-length-percentage\u2466"},{"id":"ref-for-typedef-length-percentage\u2467"}],"title":"3.1.3. \nMaximum Size Properties: the max-width and max-height properties"},{"refs":[{"id":"ref-for-typedef-length-percentage\u2468"},{"id":"ref-for-typedef-length-percentage\u2460\u24ea"},{"id":"ref-for-typedef-length-percentage\u2460\u2460"},{"id":"ref-for-typedef-length-percentage\u2460\u2461"},{"id":"ref-for-typedef-length-percentage\u2460\u2462"},{"id":"ref-for-typedef-length-percentage\u2460\u2463"},{"id":"ref-for-typedef-length-percentage\u2460\u2464"}],"title":"3.2. \nSizing Values: the <length-percentage [0,\u221e]>, auto | none, min-content, max-content, and fit-content() values"},{"refs":[{"id":"ref-for-typedef-length-percentage\u2460\u2465"},{"id":"ref-for-typedef-length-percentage\u2460\u2466"},{"id":"ref-for-typedef-length-percentage\u2460\u2467"},{"id":"ref-for-typedef-length-percentage\u2460\u2468"}],"title":"3.3. \nBox Edges for Sizing: the box-sizing property"},{"refs":[{"id":"ref-for-typedef-length-percentage\u2461\u24ea"},{"id":"ref-for-typedef-length-percentage\u2461\u2460"},{"id":"ref-for-typedef-length-percentage\u2461\u2461"},{"id":"ref-for-typedef-length-percentage\u2461\u2462"}],"title":"3.4. \nNew Column Sizing Values: the min-content, max-content, and fit-content() values"},{"refs":[{"id":"ref-for-typedef-length-percentage\u2461\u2463"}],"title":"5.2.1. \nIntrinsic Contributions of Percentage-Sized Boxes"}],"url":"https://drafts.csswg.org/css-values-4/#typedef-length-percentage"}, "190183bb": {"dfnID":"190183bb","dfnText":"block size","external":true,"refSections":[{"refs":[{"id":"ref-for-block-size"},{"id":"ref-for-block-size\u2460"}],"title":"2. \nTerminology"},{"refs":[{"id":"ref-for-block-size\u2461"}],"title":"2.1. \nAuto Box Sizes"},{"refs":[{"id":"ref-for-block-size\u2462"},{"id":"ref-for-block-size\u2463"},{"id":"ref-for-block-size\u2464"}],"title":"3.2. \nSizing Values: the <length-percentage [0,\u221e]>, auto | none, min-content, max-content, and fit-content() values"},{"refs":[{"id":"ref-for-block-size\u2465"}],"title":"5.2.1. \nIntrinsic Contributions of Percentage-Sized Boxes"}],"url":"https://drafts.csswg.org/css-writing-modes-4/#block-size"}, "1ea6c25d": {"dfnID":"1ea6c25d","dfnText":"margin properties","external":true,"refSections":[{"refs":[{"id":"ref-for-margin-properties"}],"title":"5.2.1. \nIntrinsic Contributions of Percentage-Sized Boxes"}],"url":"https://drafts.csswg.org/css-box-4/#margin-properties"}, "23012643": {"dfnID":"23012643","dfnText":"natural aspect ratio","external":true,"refSections":[{"refs":[{"id":"ref-for-natural-aspect-ratio"}],"title":"2.3. \nIntrinsic Size Constraints"}],"url":"https://drafts.csswg.org/css-images-3/#natural-aspect-ratio"}, "32995ff0": {"dfnID":"32995ff0","dfnText":"block-axis","external":true,"refSections":[{"refs":[{"id":"ref-for-block-axis"},{"id":"ref-for-block-axis\u2460"}],"title":"2.1. \nAuto Box Sizes"},{"refs":[{"id":"ref-for-block-axis\u2461"}],"title":"5.2.1. \nIntrinsic Contributions of Percentage-Sized Boxes"}],"url":"https://drafts.csswg.org/css-writing-modes-4/#block-axis"}, "358fd6ff": {"dfnID":"358fd6ff","dfnText":"CSS-wide keywords","external":true,"refSections":[{"refs":[{"id":"ref-for-css-wide-keywords"}],"title":"1.2. \nValue Definitions"}],"url":"https://drafts.csswg.org/css-values-4/#css-wide-keywords"}, "37f0daea": {"dfnID":"37f0daea","dfnText":"inline size","external":true,"refSections":[{"refs":[{"id":"ref-for-inline-size"},{"id":"ref-for-inline-size\u2460"}],"title":"2. \nTerminology"},{"refs":[{"id":"ref-for-inline-size\u2461"},{"id":"ref-for-inline-size\u2462"}],"title":"2.1. \nAuto Box Sizes"},{"refs":[{"id":"ref-for-inline-size\u2463"}],"title":"3.2. \nSizing Values: the <length-percentage [0,\u221e]>, auto | none, min-content, max-content, and fit-content() values"},{"refs":[{"id":"ref-for-inline-size\u2464"}],"title":"5.1. \nIntrinsic Sizes"}],"url":"https://drafts.csswg.org/css-writing-modes-4/#inline-size"}, "3fe04ff7": {"dfnID":"3fe04ff7","dfnText":"size containment","external":true,"refSections":[{"refs":[{"id":"ref-for-size-containment"}],"title":"2. \nTerminology"}],"url":"https://drafts.csswg.org/css-contain-2/#size-containment"}, "426739b5": {"dfnID":"426739b5","dfnText":"contain","external":true,"refSections":[{"refs":[{"id":"ref-for-valdef-width-contain"}],"title":"3.2. \nSizing Values: the <length-percentage [0,\u221e]>, auto | none, min-content, max-content, and fit-content() values"}],"url":"https://drafts.csswg.org/css-sizing-4/#valdef-width-contain"}, "43667deb": {"dfnID":"43667deb","dfnText":"inline axis","external":true,"refSections":[{"refs":[{"id":"ref-for-inline-axis"},{"id":"ref-for-inline-axis\u2460"},{"id":"ref-for-inline-axis\u2461"}],"title":"2.1. \nAuto Box Sizes"},{"refs":[{"id":"ref-for-inline-axis\u2462"}],"title":"5.1. \nIntrinsic Sizes"}],"url":"https://drafts.csswg.org/css-writing-modes-4/#inline-axis"}, "46c6a718": {"dfnID":"46c6a718","dfnText":"content box","external":true,"refSections":[{"refs":[{"id":"ref-for-content-box"}],"title":"2.3. \nIntrinsic Size Constraints"},{"refs":[{"id":"ref-for-content-box\u2460"}],"title":"3.2. \nSizing Values: the <length-percentage [0,\u221e]>, auto | none, min-content, max-content, and fit-content() values"},{"refs":[{"id":"ref-for-content-box\u2461"},{"id":"ref-for-content-box\u2462"},{"id":"ref-for-content-box\u2463"},{"id":"ref-for-content-box\u2464"}],"title":"3.3. \nBox Edges for Sizing: the box-sizing property"}],"url":"https://drafts.csswg.org/css-box-4/#content-box"}, "4fe61159": {"dfnID":"4fe61159","dfnText":"resolved value","external":true,"refSections":[{"refs":[{"id":"ref-for-resolved-value"}],"title":"3.2. \nSizing Values: the <length-percentage [0,\u221e]>, auto | none, min-content, max-content, and fit-content() values"}],"url":"https://drafts.csswg.org/cssom-1/#resolved-value"}, "54aa64f0": {"dfnID":"54aa64f0","dfnText":"margin","external":true,"refSections":[{"refs":[{"id":"ref-for-margin"}],"title":"5.2.1. \nIntrinsic Contributions of Percentage-Sized Boxes"}],"url":"https://drafts.csswg.org/css-box-4/#margin"}, "5722daa9": {"dfnID":"5722daa9","dfnText":"box","external":true,"refSections":[{"refs":[{"id":"ref-for-box"},{"id":"ref-for-box\u2460"}],"title":"2. \nTerminology"},{"refs":[{"id":"ref-for-box\u2461"}],"title":"3.3. \nBox Edges for Sizing: the box-sizing property"}],"url":"https://drafts.csswg.org/css-display-3/#box"}, "5ee7eb9e": {"dfnID":"5ee7eb9e","dfnText":"@page","external":true,"refSections":[{"refs":[{"id":"ref-for-at-ruledef-page"}],"title":"3.1. \nSizing Properties"}],"url":"https://drafts.csswg.org/css-page-3/#at-ruledef-page"}, "5eff29c1": {"dfnID":"5eff29c1","dfnText":"flow-relative","external":true,"refSections":[{"refs":[{"id":"ref-for-flow-relative"}],"title":"3.1. \nSizing Properties"}],"url":"https://drafts.csswg.org/css-writing-modes-4/#flow-relative"}, "66aee777": {"dfnID":"66aee777","dfnText":"type","external":true,"refSections":[{"refs":[{"id":"ref-for-attr-input-type"}],"title":"5.2.2. \nCompressible Replaced Elements"}],"url":"https://html.spec.whatwg.org/multipage/input.html#attr-input-type"}, "66c521a7": {"dfnID":"66c521a7","dfnText":"flex item","external":true,"refSections":[{"refs":[{"id":"ref-for-flex-item"}],"title":"5.2.1. \nIntrinsic Contributions of Percentage-Sized Boxes"}],"url":"https://drafts.csswg.org/css-flexbox-1/#flex-item"}, "6b6ef55d": {"dfnID":"6b6ef55d","dfnText":"inline","external":true,"refSections":[{"refs":[{"id":"ref-for-inline"}],"title":"3.1.1. \nPreferred Size Properties: the width and height properties"}],"url":"https://drafts.csswg.org/css-display-4/#inline"}, "6b7e1616": {"dfnID":"6b7e1616","dfnText":"padding properties","external":true,"refSections":[{"refs":[{"id":"ref-for-padding-properties"}],"title":"5.2.1. \nIntrinsic Contributions of Percentage-Sized Boxes"}],"url":"https://drafts.csswg.org/css-box-4/#padding-properties"}, "6ec67710": {"dfnID":"6ec67710","dfnText":"|","external":true,"refSections":[{"refs":[{"id":"ref-for-comb-one"},{"id":"ref-for-comb-one\u2460"},{"id":"ref-for-comb-one\u2461"},{"id":"ref-for-comb-one\u2462"},{"id":"ref-for-comb-one\u2463"}],"title":"3.1.1. \nPreferred Size Properties: the width and height properties"},{"refs":[{"id":"ref-for-comb-one\u2464"},{"id":"ref-for-comb-one\u2465"},{"id":"ref-for-comb-one\u2466"},{"id":"ref-for-comb-one\u2467"},{"id":"ref-for-comb-one\u2468"}],"title":"3.1.2. \nMinimum Size Properties: the min-width and min-height properties"},{"refs":[{"id":"ref-for-comb-one\u2460\u24ea"},{"id":"ref-for-comb-one\u2460\u2460"},{"id":"ref-for-comb-one\u2460\u2461"},{"id":"ref-for-comb-one\u2460\u2462"},{"id":"ref-for-comb-one\u2460\u2463"}],"title":"3.1.3. \nMaximum Size Properties: the max-width and max-height properties"},{"refs":[{"id":"ref-for-comb-one\u2460\u2464"}],"title":"3.3. \nBox Edges for Sizing: the box-sizing property"},{"refs":[{"id":"ref-for-comb-one\u2460\u2465"},{"id":"ref-for-comb-one\u2460\u2466"}],"title":"3.4. \nNew Column Sizing Values: the min-content, max-content, and fit-content() values"}],"url":"https://drafts.csswg.org/css-values-4/#comb-one"}, "73a98e20": {"dfnID":"73a98e20","dfnText":"flex layout","external":true,"refSections":[{"refs":[{"id":"ref-for-flex-layout"}],"title":"5.2.1. \nIntrinsic Contributions of Percentage-Sized Boxes"}],"url":"https://drafts.csswg.org/css-flexbox-1/#flex-layout"}, "799c2725": {"dfnID":"799c2725","dfnText":"fit-content","external":true,"refSections":[{"refs":[{"id":"ref-for-valdef-width-fit-content"}],"title":"3.2. \nSizing Values: the <length-percentage [0,\u221e]>, auto | none, min-content, max-content, and fit-content() values"},{"refs":[{"id":"ref-for-valdef-width-fit-content\u2460"}],"title":"\nRecent Changes"}],"url":"https://drafts.csswg.org/css-sizing-4/#valdef-width-fit-content"}, "7de09c13": {"dfnID":"7de09c13","dfnText":"flex-basis","external":true,"refSections":[{"refs":[{"id":"ref-for-propdef-flex-basis"}],"title":"3.2. \nSizing Values: the <length-percentage [0,\u221e]>, auto | none, min-content, max-content, and fit-content() values"},{"refs":[{"id":"ref-for-propdef-flex-basis\u2460"}],"title":"3.3. \nBox Edges for Sizing: the box-sizing property"},{"refs":[{"id":"ref-for-propdef-flex-basis\u2461"}],"title":"5.2.1. \nIntrinsic Contributions of Percentage-Sized Boxes"}],"url":"https://drafts.csswg.org/css-flexbox-1/#propdef-flex-basis"}, "7e6af1ac": {"dfnID":"7e6af1ac","dfnText":"gutter","external":true,"refSections":[{"refs":[{"id":"ref-for-gutter"}],"title":"5.2.1. \nIntrinsic Contributions of Percentage-Sized Boxes"}],"url":"https://drafts.csswg.org/css-align-3/#gutter"}, "83d1e90e": {"dfnID":"83d1e90e","dfnText":"marquee","external":true,"refSections":[{"refs":[{"id":"ref-for-the-marquee-element"}],"title":"5.2.2. \nCompressible Replaced Elements"}],"url":"https://html.spec.whatwg.org/multipage/obsolete.html#the-marquee-element"}, "85188fb3": {"dfnID":"85188fb3","dfnText":"select","external":true,"refSections":[{"refs":[{"id":"ref-for-the-select-element"}],"title":"5.2.1. \nIntrinsic Contributions of Percentage-Sized Boxes"},{"refs":[{"id":"ref-for-the-select-element\u2460"}],"title":"5.2.2. \nCompressible Replaced Elements"}],"url":"https://html.spec.whatwg.org/multipage/form-elements.html#the-select-element"}, "87fcd40c": {"dfnID":"87fcd40c","dfnText":"iframe","external":true,"refSections":[{"refs":[{"id":"ref-for-the-iframe-element"}],"title":"5.1. \nIntrinsic Sizes"},{"refs":[{"id":"ref-for-the-iframe-element\u2460"}],"title":"\nPrivacy and Security Considerations"}],"url":"https://html.spec.whatwg.org/multipage/iframe-embed-object.html#the-iframe-element"}, "8d0ede2c": {"dfnID":"8d0ede2c","dfnText":"initial containing block","external":true,"refSections":[{"refs":[{"id":"ref-for-initial-containing-block"},{"id":"ref-for-initial-containing-block\u2460"}],"title":"2. \nTerminology"},{"refs":[{"id":"ref-for-initial-containing-block\u2461"}],"title":"5.1. \nIntrinsic Sizes"}],"url":"https://drafts.csswg.org/css-display-4/#initial-containing-block"}, "8e39589a": {"dfnID":"8e39589a","dfnText":"block box","external":true,"refSections":[{"refs":[{"id":"ref-for-block-box"}],"title":"3.2.2. \nContaining or Excluding Floats"}],"url":"https://drafts.csswg.org/css-display-4/#block-box"}, "94f59a47": {"dfnID":"94f59a47","dfnText":"replaced","external":true,"refSections":[{"refs":[{"id":"ref-for-replaced-element"}],"title":"2.1. \nAuto Box Sizes"},{"refs":[{"id":"ref-for-replaced-element\u2460"}],"title":"5.1. \nIntrinsic Sizes"},{"refs":[{"id":"ref-for-replaced-element\u2461"},{"id":"ref-for-replaced-element\u2462"},{"id":"ref-for-replaced-element\u2463"}],"title":"5.2.1. \nIntrinsic Contributions of Percentage-Sized Boxes"},{"refs":[{"id":"ref-for-replaced-element\u2464"},{"id":"ref-for-replaced-element\u2465"}],"title":"5.2.2. \nCompressible Replaced Elements"},{"refs":[{"id":"ref-for-replaced-element\u2466"}],"title":"\nPrivacy and Security Considerations"}],"url":"https://drafts.csswg.org/css-display-4/#replaced-element"}, "9620c79b": {"dfnID":"9620c79b","dfnText":"contain-intrinsic-size","external":true,"refSections":[{"refs":[{"id":"ref-for-propdef-contain-intrinsic-size"},{"id":"ref-for-propdef-contain-intrinsic-size\u2460"}],"title":"\nRecent Changes"}],"url":"https://drafts.csswg.org/css-sizing-4/#propdef-contain-intrinsic-size"}, "9acf31c7": {"dfnID":"9acf31c7","dfnText":"auto","external":true,"refSections":[{"refs":[{"id":"ref-for-valdef-contain-intrinsic-width-auto"}],"title":"\nRecent Changes"}],"url":"https://drafts.csswg.org/css-sizing-4/#valdef-contain-intrinsic-width-auto"}, "9cd25054": {"dfnID":"9cd25054","dfnText":"computed value","external":true,"refSections":[{"refs":[{"id":"ref-for-computed-value"}],"title":"3.3. \nBox Edges for Sizing: the box-sizing property"},{"refs":[{"id":"ref-for-computed-value\u2460"},{"id":"ref-for-computed-value\u2461"}],"title":"5.1. \nIntrinsic Sizes"}],"url":"https://drafts.csswg.org/css-cascade-5/#computed-value"}, "9ea6bed2": {"dfnID":"9ea6bed2","dfnText":"initial value","external":true,"refSections":[{"refs":[{"id":"ref-for-initial-value"},{"id":"ref-for-initial-value\u2460"}],"title":"5.2.1. \nIntrinsic Contributions of Percentage-Sized Boxes"}],"url":"https://drafts.csswg.org/css-cascade-5/#initial-value"}, "9f3d4f17": {"dfnID":"9f3d4f17","dfnText":"block container","external":true,"refSections":[{"refs":[{"id":"ref-for-block-container"}],"title":"2.1. \nAuto Box Sizes"}],"url":"https://drafts.csswg.org/css-display-4/#block-container"}, "a73617e0": {"dfnID":"a73617e0","dfnText":"writing mode","external":true,"refSections":[{"refs":[{"id":"ref-for-writing-mode"}],"title":"2. \nTerminology"}],"url":"https://drafts.csswg.org/css-writing-modes-4/#writing-mode"}, "a8485ff4": {"dfnID":"a8485ff4","dfnText":"replaced element","external":true,"refSections":[{"refs":[{"id":"ref-for-replaced-element"}],"title":"2.1. \nAuto Box Sizes"},{"refs":[{"id":"ref-for-replaced-element\u2460"}],"title":"5.1. \nIntrinsic Sizes"},{"refs":[{"id":"ref-for-replaced-element\u2461"},{"id":"ref-for-replaced-element\u2462"},{"id":"ref-for-replaced-element\u2463"}],"title":"5.2.1. \nIntrinsic Contributions of Percentage-Sized Boxes"},{"refs":[{"id":"ref-for-replaced-element\u2464"},{"id":"ref-for-replaced-element\u2465"}],"title":"5.2.2. \nCompressible Replaced Elements"},{"refs":[{"id":"ref-for-replaced-element\u2466"}],"title":"\nPrivacy and Security Considerations"}],"url":"https://drafts.csswg.org/css-display-4/#replaced-element"}, "a9734ee4": {"dfnID":"a9734ee4","dfnText":"border","external":true,"refSections":[{"refs":[{"id":"ref-for-propdef-border"}],"title":"3.3. \nBox Edges for Sizing: the box-sizing property"}],"url":"https://drafts.csswg.org/css-backgrounds-3/#propdef-border"}, "ac6ecea0": {"dfnID":"ac6ecea0","dfnText":"text sequence","external":true,"refSections":[{"refs":[{"id":"ref-for-css-text-sequence"}],"title":"5.1. \nIntrinsic Sizes"}],"url":"https://drafts.csswg.org/css-display-4/#css-text-sequence"}, "automatic-block-size": {"dfnID":"automatic-block-size","dfnText":"automatic block size","external":false,"refSections":[],"url":"#automatic-block-size"}, "automatic-inline-size": {"dfnID":"automatic-inline-size","dfnText":"automatic inline size","external":false,"refSections":[],"url":"#automatic-inline-size"}, "automatic-minimum-size": {"dfnID":"automatic-minimum-size","dfnText":"automatic minimum size","external":false,"refSections":[{"refs":[{"id":"ref-for-automatic-minimum-size"},{"id":"ref-for-automatic-minimum-size\u2460"}],"title":"5.2.1. \nIntrinsic Contributions of Percentage-Sized Boxes"}],"url":"#automatic-minimum-size"}, "automatic-size": {"dfnID":"automatic-size","dfnText":"automatic size","external":false,"refSections":[{"refs":[{"id":"ref-for-automatic-size"},{"id":"ref-for-automatic-size\u2460"}],"title":"3.2. \nSizing Values: the <length-percentage [0,\u221e]>, auto | none, min-content, max-content, and fit-content() values"},{"refs":[{"id":"ref-for-automatic-size\u2461"}],"title":"3.2.1. \n\u201cBehaving as auto\u201d"}],"url":"#automatic-size"}, "available": {"dfnID":"available","dfnText":"available space","external":false,"refSections":[{"refs":[{"id":"ref-for-available"},{"id":"ref-for-available\u2460"}],"title":"2. \nTerminology"},{"refs":[{"id":"ref-for-available\u2461"},{"id":"ref-for-available\u2462"},{"id":"ref-for-available\u2463"},{"id":"ref-for-available\u2464"},{"id":"ref-for-available\u2465"}],"title":"2.1. \nAuto Box Sizes"},{"refs":[{"id":"ref-for-available\u2466"},{"id":"ref-for-available\u2467"}],"title":"3.2. \nSizing Values: the <length-percentage [0,\u221e]>, auto | none, min-content, max-content, and fit-content() values"},{"refs":[{"id":"ref-for-available\u2468"}],"title":"5.1. \nIntrinsic Sizes"}],"url":"#available"}, "b203675a": {"dfnID":"b203675a","dfnText":"getComputedStyle(elt)","external":true,"refSections":[{"refs":[{"id":"ref-for-dom-window-getcomputedstyle"}],"title":"3.3. \nBox Edges for Sizing: the box-sizing property"}],"url":"https://drafts.csswg.org/cssom-1/#dom-window-getcomputedstyle"}, "b23654ab": {"dfnID":"b23654ab","dfnText":"meter","external":true,"refSections":[{"refs":[{"id":"ref-for-the-meter-element"}],"title":"5.2.2. \nCompressible Replaced Elements"}],"url":"https://html.spec.whatwg.org/multipage/form-elements.html#the-meter-element"}, "b3bf6f52": {"dfnID":"b3bf6f52","dfnText":"raw value","external":true,"refSections":[{"refs":[{"id":"ref-for-concept-textarea-raw-value"}],"title":"5.1. \nIntrinsic Sizes"}],"url":"https://html.spec.whatwg.org/multipage/form-elements.html#concept-textarea-raw-value"}, "b90b2ad5": {"dfnID":"b90b2ad5","dfnText":"progress","external":true,"refSections":[{"refs":[{"id":"ref-for-the-progress-element"}],"title":"5.2.2. \nCompressible Replaced Elements"}],"url":"https://html.spec.whatwg.org/multipage/form-elements.html#the-progress-element"}, "behave-as-auto": {"dfnID":"behave-as-auto","dfnText":"behave as auto","external":false,"refSections":[{"refs":[{"id":"ref-for-behave-as-auto"}],"title":"3.2.1. \n\u201cBehaving as auto\u201d"},{"refs":[{"id":"ref-for-behave-as-auto\u2460"},{"id":"ref-for-behave-as-auto\u2461"}],"title":"5.1. \nIntrinsic Sizes"},{"refs":[{"id":"ref-for-behave-as-auto\u2462"},{"id":"ref-for-behave-as-auto\u2463"},{"id":"ref-for-behave-as-auto\u2464"},{"id":"ref-for-behave-as-auto\u2465"}],"title":"5.2.1. \nIntrinsic Contributions of Percentage-Sized Boxes"}],"url":"#behave-as-auto"}, "bfff6250": {"dfnID":"bfff6250","dfnText":"button","external":true,"refSections":[{"refs":[{"id":"ref-for-the-button-element"}],"title":"3.3. \nBox Edges for Sizing: the box-sizing property"},{"refs":[{"id":"ref-for-the-button-element\u2460"}],"title":"5.2.2. \nCompressible Replaced Elements"}],"url":"https://html.spec.whatwg.org/multipage/form-elements.html#the-button-element"}, "c1b73c63": {"dfnID":"c1b73c63","dfnText":"padding","external":true,"refSections":[{"refs":[{"id":"ref-for-padding"}],"title":"5.2.1. \nIntrinsic Contributions of Percentage-Sized Boxes"}],"url":"https://drafts.csswg.org/css-box-4/#padding"}, "c914acd1": {"dfnID":"c914acd1","dfnText":"max-block-size","external":true,"refSections":[{"refs":[{"id":"ref-for-propdef-max-block-size"}],"title":"5.2.1. \nIntrinsic Contributions of Percentage-Sized Boxes"}],"url":"https://drafts.csswg.org/css-logical-1/#propdef-max-block-size"}, "constraints": {"dfnID":"constraints","dfnText":"2.3. \nIntrinsic Size Constraints","external":false,"refSections":[{"refs":[{"id":"ref-for-constraints"}],"title":"2.3. \nIntrinsic Size Constraints"}],"url":"#constraints"}, "cyclic-percentage-size": {"dfnID":"cyclic-percentage-size","dfnText":"cyclic percentage size","external":false,"refSections":[{"refs":[{"id":"ref-for-cyclic-percentage-size"},{"id":"ref-for-cyclic-percentage-size\u2460"},{"id":"ref-for-cyclic-percentage-size\u2461"},{"id":"ref-for-cyclic-percentage-size\u2462"}],"title":"5.2.1. \nIntrinsic Contributions of Percentage-Sized Boxes"},{"refs":[{"id":"ref-for-cyclic-percentage-size\u2463"}],"title":"\nRecent Changes"}],"url":"#cyclic-percentage-size"}, "d3936525": {"dfnID":"d3936525","dfnText":"natural dimension","external":true,"refSections":[{"refs":[{"id":"ref-for-natural-dimensions"}],"title":"2.1. \nAuto Box Sizes"}],"url":"https://drafts.csswg.org/css-images-3/#natural-dimensions"}, "d7d642a2": {"dfnID":"d7d642a2","dfnText":"input","external":true,"refSections":[{"refs":[{"id":"ref-for-the-input-element"}],"title":"5.1. \nIntrinsic Sizes"},{"refs":[{"id":"ref-for-the-input-element\u2460"}],"title":"5.2.1. \nIntrinsic Contributions of Percentage-Sized Boxes"},{"refs":[{"id":"ref-for-the-input-element\u2461"}],"title":"5.2.2. \nCompressible Replaced Elements"}],"url":"https://html.spec.whatwg.org/multipage/input.html#the-input-element"}, "d9c76793": {"dfnID":"d9c76793","dfnText":"physical","external":true,"refSections":[{"refs":[{"id":"ref-for-physical"}],"title":"3.1.1. \nPreferred Size Properties: the width and height properties"}],"url":"https://drafts.csswg.org/css-writing-modes-4/#physical"}, "definite": {"dfnID":"definite","dfnText":"definite size","external":false,"refSections":[{"refs":[{"id":"ref-for-definite"},{"id":"ref-for-definite\u2460"},{"id":"ref-for-definite\u2461"},{"id":"ref-for-definite\u2462"}],"title":"2. \nTerminology"},{"refs":[{"id":"ref-for-definite\u2463"},{"id":"ref-for-definite\u2464"}],"title":"2.1. \nAuto Box Sizes"},{"refs":[{"id":"ref-for-definite\u2465"},{"id":"ref-for-definite\u2466"},{"id":"ref-for-definite\u2467"}],"title":"4.1. \n\tPercentage Sizing"},{"refs":[{"id":"ref-for-definite\u2468"}],"title":"5.1. \nIntrinsic Sizes"},{"refs":[{"id":"ref-for-definite\u2460\u24ea"},{"id":"ref-for-definite\u2460\u2460"}],"title":"5.2.1. \nIntrinsic Contributions of Percentage-Sized Boxes"}],"url":"#definite"}, "e1ab41b7": {"dfnID":"e1ab41b7","dfnText":"block axis","external":true,"refSections":[{"refs":[{"id":"ref-for-block-axis"},{"id":"ref-for-block-axis\u2460"}],"title":"2.1. \nAuto Box Sizes"},{"refs":[{"id":"ref-for-block-axis\u2461"}],"title":"5.2.1. \nIntrinsic Contributions of Percentage-Sized Boxes"}],"url":"https://drafts.csswg.org/css-writing-modes-4/#block-axis"}, "ea663a43": {"dfnID":"ea663a43","dfnText":"containing block","external":true,"refSections":[{"refs":[{"id":"ref-for-containing-block"},{"id":"ref-for-containing-block\u2460"}],"title":"2. \nTerminology"},{"refs":[{"id":"ref-for-containing-block\u2461"},{"id":"ref-for-containing-block\u2462"}],"title":"2.2. \nIntrinsic Size Contributions"},{"refs":[{"id":"ref-for-containing-block\u2463"},{"id":"ref-for-containing-block\u2464"}],"title":"2.3. \nIntrinsic Size Constraints"},{"refs":[{"id":"ref-for-containing-block\u2465"}],"title":"3.1.1. \nPreferred Size Properties: the width and height properties"},{"refs":[{"id":"ref-for-containing-block\u2466"}],"title":"3.1.2. \nMinimum Size Properties: the min-width and min-height properties"},{"refs":[{"id":"ref-for-containing-block\u2467"}],"title":"3.1.3. \nMaximum Size Properties: the max-width and max-height properties"},{"refs":[{"id":"ref-for-containing-block\u2468"},{"id":"ref-for-containing-block\u2460\u24ea"}],"title":"3.2. \nSizing Values: the <length-percentage [0,\u221e]>, auto | none, min-content, max-content, and fit-content() values"},{"refs":[{"id":"ref-for-containing-block\u2460\u2460"},{"id":"ref-for-containing-block\u2460\u2461"}],"title":"4.1. \n\tPercentage Sizing"},{"refs":[{"id":"ref-for-containing-block\u2460\u2462"}],"title":"5.2.1. \nIntrinsic Contributions of Percentage-Sized Boxes"}],"url":"https://drafts.csswg.org/css-display-4/#containing-block"}, "ed3eb665": {"dfnID":"ed3eb665","dfnText":"natural size","external":true,"refSections":[{"refs":[{"id":"ref-for-natural-size"}],"title":"5.1. \nIntrinsic Sizes"}],"url":"https://drafts.csswg.org/css-images-3/#natural-size"}, "extrinsic-sizing": {"dfnID":"extrinsic-sizing","dfnText":"Extrinsic sizing","external":false,"refSections":[],"url":"#extrinsic-sizing"}, "f0c46389": {"dfnID":"f0c46389","dfnText":"block-size","external":true,"refSections":[{"refs":[{"id":"ref-for-propdef-block-size"}],"title":"5.2.1. \nIntrinsic Contributions of Percentage-Sized Boxes"}],"url":"https://drafts.csswg.org/css-logical-1/#propdef-block-size"}, "f2401ef5": {"dfnID":"f2401ef5","dfnText":"contain a percentage","external":true,"refSections":[{"refs":[{"id":"ref-for-css-contain-a-percentage"}],"title":"5.2.1. \nIntrinsic Contributions of Percentage-Sized Boxes"}],"url":"https://drafts.csswg.org/css-values-4/#css-contain-a-percentage"}, "f598742d": {"dfnID":"f598742d","dfnText":"border box","external":true,"refSections":[{"refs":[{"id":"ref-for-border-box"}],"title":"3.2. \nSizing Values: the <length-percentage [0,\u221e]>, auto | none, min-content, max-content, and fit-content() values"},{"refs":[{"id":"ref-for-border-box\u2460"},{"id":"ref-for-border-box\u2461"}],"title":"3.3. \nBox Edges for Sizing: the box-sizing property"}],"url":"https://drafts.csswg.org/css-box-4/#border-box"}, "f8cff8d7": {"dfnID":"f8cff8d7","dfnText":"column-width","external":true,"refSections":[{"refs":[{"id":"ref-for-propdef-column-width"}],"title":"Unnumbered Section"},{"refs":[{"id":"ref-for-propdef-column-width\u2460"}],"title":"1.1. \nModule interactions"},{"refs":[{"id":"ref-for-propdef-column-width\u2461"},{"id":"ref-for-propdef-column-width\u2462"}],"title":"3.4. \nNew Column Sizing Values: the min-content, max-content, and fit-content() values"}],"url":"https://drafts.csswg.org/css-multicol-2/#propdef-column-width"}, "f952f01b": {"dfnID":"f952f01b","dfnText":"non-replaced","external":true,"refSections":[{"refs":[{"id":"ref-for-non-replaced"}],"title":"3.1.1. \nPreferred Size Properties: the width and height properties"},{"refs":[{"id":"ref-for-non-replaced\u2460"},{"id":"ref-for-non-replaced\u2461"}],"title":"5.2.1. \nIntrinsic Contributions of Percentage-Sized Boxes"}],"url":"https://drafts.csswg.org/css-display-4/#non-replaced"}, "fallback": {"dfnID":"fallback","dfnText":"fallback size","external":false,"refSections":[{"refs":[{"id":"ref-for-fallback"}],"title":"2. \nTerminology"}],"url":"#fallback"}, "fb030e6c": {"dfnID":"fb030e6c","dfnText":"<length>","external":true,"refSections":[{"refs":[{"id":"ref-for-length-value"}],"title":"2. \nTerminology"},{"refs":[{"id":"ref-for-length-value\u2460"}],"title":"3.2. \nSizing Values: the <length-percentage [0,\u221e]>, auto | none, min-content, max-content, and fit-content() values"},{"refs":[{"id":"ref-for-length-value\u2461"}],"title":"3.3. \nBox Edges for Sizing: the box-sizing property"},{"refs":[{"id":"ref-for-length-value\u2462"},{"id":"ref-for-length-value\u2463"},{"id":"ref-for-length-value\u2464"}],"title":"5.1. \nIntrinsic Sizes"},{"refs":[{"id":"ref-for-length-value\u2465"}],"title":"\nRecent Changes"}],"url":"https://drafts.csswg.org/css-values-4/#length-value"}, "fc736137": {"dfnID":"fc736137","dfnText":"textarea","external":true,"refSections":[{"refs":[{"id":"ref-for-the-textarea-element"}],"title":"5.1. \nIntrinsic Sizes"},{"refs":[{"id":"ref-for-the-textarea-element\u2460"}],"title":"5.2.2. \nCompressible Replaced Elements"}],"url":"https://html.spec.whatwg.org/multipage/form-elements.html#the-textarea-element"}, "fit-content-block-size": {"dfnID":"fit-content-block-size","dfnText":"fit-content block size","external":false,"refSections":[],"url":"#fit-content-block-size"}, "fit-content-inline-size": {"dfnID":"fit-content-inline-size","dfnText":"fit-content inline size","external":false,"refSections":[],"url":"#fit-content-inline-size"}, "fit-content-size": {"dfnID":"fit-content-size","dfnText":"fit-content size","external":false,"refSections":[{"refs":[{"id":"ref-for-fit-content-size"}],"title":"3.2. \nSizing Values: the <length-percentage [0,\u221e]>, auto | none, min-content, max-content, and fit-content() values"},{"refs":[{"id":"ref-for-fit-content-size\u2460"}],"title":"\nRecent Changes"}],"url":"#fit-content-size"}, "funcdef-width-calc-size": {"dfnID":"funcdef-width-calc-size","dfnText":"calc-size()","external":false,"refSections":[{"refs":[{"id":"ref-for-funcdef-width-calc-size"}],"title":"3.1.1. \nPreferred Size Properties: the width and height properties"},{"refs":[{"id":"ref-for-funcdef-width-calc-size\u2460"}],"title":"3.1.2. \nMinimum Size Properties: the min-width and min-height properties"},{"refs":[{"id":"ref-for-funcdef-width-calc-size\u2461"}],"title":"3.1.3. \nMaximum Size Properties: the max-width and max-height properties"},{"refs":[{"id":"ref-for-funcdef-width-calc-size\u2462"},{"id":"ref-for-funcdef-width-calc-size\u2463"}],"title":"3.2. \nSizing Values: the <length-percentage [0,\u221e]>, auto | none, min-content, max-content, and fit-content() values"}],"url":"#funcdef-width-calc-size"}, "funcdef-width-fit-content": {"dfnID":"funcdef-width-fit-content","dfnText":"fit-content(<length-percentage [0,\u221e]>)","external":false,"refSections":[{"refs":[{"id":"ref-for-funcdef-width-fit-content"}],"title":"3.1.1. \nPreferred Size Properties: the width and height properties"},{"refs":[{"id":"ref-for-funcdef-width-fit-content\u2460"}],"title":"3.1.2. \nMinimum Size Properties: the min-width and min-height properties"},{"refs":[{"id":"ref-for-funcdef-width-fit-content\u2461"}],"title":"3.1.3. \nMaximum Size Properties: the max-width and max-height properties"},{"refs":[{"id":"ref-for-funcdef-width-fit-content\u2462"},{"id":"ref-for-funcdef-width-fit-content\u2463"}],"title":"3.2. \nSizing Values: the <length-percentage [0,\u221e]>, auto | none, min-content, max-content, and fit-content() values"},{"refs":[{"id":"ref-for-funcdef-width-fit-content\u2464"}],"title":"3.3. \nBox Edges for Sizing: the box-sizing property"},{"refs":[{"id":"ref-for-funcdef-width-fit-content\u2465"},{"id":"ref-for-funcdef-width-fit-content\u2466"}],"title":"\nRecent Changes"},{"refs":[{"id":"ref-for-funcdef-width-fit-content\u2467"}],"title":"\nAdditions since CSS Level 2"}],"url":"#funcdef-width-fit-content"}, "height": {"dfnID":"height","dfnText":"height","external":false,"refSections":[{"refs":[{"id":"ref-for-height"},{"id":"ref-for-height\u2460"}],"title":"2. \nTerminology"},{"refs":[{"id":"ref-for-height\u2461"}],"title":"3.3. \nBox Edges for Sizing: the box-sizing property"}],"url":"#height"}, "indefinite": {"dfnID":"indefinite","dfnText":"indefinite size","external":false,"refSections":[{"refs":[{"id":"ref-for-indefinite"},{"id":"ref-for-indefinite\u2460"}],"title":"2. \nTerminology"},{"refs":[{"id":"ref-for-indefinite\u2461"},{"id":"ref-for-indefinite\u2462"}],"title":"2.1. \nAuto Box Sizes"},{"refs":[{"id":"ref-for-indefinite\u2463"}],"title":"3.2. \nSizing Values: the <length-percentage [0,\u221e]>, auto | none, min-content, max-content, and fit-content() values"},{"refs":[{"id":"ref-for-indefinite\u2464"}],"title":"3.2.1. \n\u201cBehaving as auto\u201d"},{"refs":[{"id":"ref-for-indefinite\u2465"}],"title":"\nRecent Changes"}],"url":"#indefinite"}, "inner-size": {"dfnID":"inner-size","dfnText":"inner size","external":false,"refSections":[{"refs":[{"id":"ref-for-inner-size"}],"title":"3.2. \nSizing Values: the <length-percentage [0,\u221e]>, auto | none, min-content, max-content, and fit-content() values"},{"refs":[{"id":"ref-for-inner-size\u2460"},{"id":"ref-for-inner-size\u2461"},{"id":"ref-for-inner-size\u2462"},{"id":"ref-for-inner-size\u2463"}],"title":"3.3. \nBox Edges for Sizing: the box-sizing property"}],"url":"#inner-size"}, "intrinsic-size": {"dfnID":"intrinsic-size","dfnText":"intrinsic size","external":false,"refSections":[{"refs":[{"id":"ref-for-intrinsic-size"}],"title":"2.1. \nAuto Box Sizes"},{"refs":[{"id":"ref-for-intrinsic-size\u2460"},{"id":"ref-for-intrinsic-size\u2461"},{"id":"ref-for-intrinsic-size\u2462"},{"id":"ref-for-intrinsic-size\u2463"}],"title":"5.1. \nIntrinsic Sizes"},{"refs":[{"id":"ref-for-intrinsic-size\u2464"}],"title":"\nRecent Changes"}],"url":"#intrinsic-size"}, "intrinsic-size-contribution": {"dfnID":"intrinsic-size-contribution","dfnText":"intrinsic size contribution","external":false,"refSections":[{"refs":[{"id":"ref-for-intrinsic-size-contribution"},{"id":"ref-for-intrinsic-size-contribution\u2460"},{"id":"ref-for-intrinsic-size-contribution\u2461"},{"id":"ref-for-intrinsic-size-contribution\u2462"},{"id":"ref-for-intrinsic-size-contribution\u2463"}],"title":"5.2.1. \nIntrinsic Contributions of Percentage-Sized Boxes"}],"url":"#intrinsic-size-contribution"}, "intrinsic-sizing": {"dfnID":"intrinsic-sizing","dfnText":"Intrinsic sizing","external":false,"refSections":[{"refs":[{"id":"ref-for-intrinsic-sizing"}],"title":"2. \nTerminology"}],"url":"#intrinsic-sizing"}, "max-content": {"dfnID":"max-content","dfnText":"max-content size","external":false,"refSections":[{"refs":[{"id":"ref-for-max-content"},{"id":"ref-for-max-content\u2460"},{"id":"ref-for-max-content\u2461"},{"id":"ref-for-max-content\u2462"}],"title":"2.1. \nAuto Box Sizes"},{"refs":[{"id":"ref-for-max-content\u2463"}],"title":"2.2. \nIntrinsic Size Contributions"},{"refs":[{"id":"ref-for-max-content\u2464"}],"title":"3.2. \nSizing Values: the <length-percentage [0,\u221e]>, auto | none, min-content, max-content, and fit-content() values"},{"refs":[{"id":"ref-for-max-content\u2465"}],"title":"3.4. \nNew Column Sizing Values: the min-content, max-content, and fit-content() values"},{"refs":[{"id":"ref-for-max-content\u2466"},{"id":"ref-for-max-content\u2467"},{"id":"ref-for-max-content\u2468"},{"id":"ref-for-max-content\u2460\u24ea"},{"id":"ref-for-max-content\u2460\u2460"},{"id":"ref-for-max-content\u2460\u2461"}],"title":"5.1. \nIntrinsic Sizes"},{"refs":[{"id":"ref-for-max-content\u2460\u2462"}],"title":"\nRecent Changes"}],"url":"#max-content"}, "max-content-block-size": {"dfnID":"max-content-block-size","dfnText":"max-content block size","external":false,"refSections":[{"refs":[{"id":"ref-for-max-content-block-size"}],"title":"2.1. \nAuto Box Sizes"}],"url":"#max-content-block-size"}, "max-content-constraint": {"dfnID":"max-content-constraint","dfnText":"max-content constraint","external":false,"refSections":[{"refs":[{"id":"ref-for-max-content-constraint"}],"title":"2. \nTerminology"}],"url":"#max-content-constraint"}, "max-content-contribution": {"dfnID":"max-content-contribution","dfnText":"max-content contribution","external":false,"refSections":[{"refs":[{"id":"ref-for-max-content-contribution"}],"title":"2.2. \nIntrinsic Size Contributions"},{"refs":[{"id":"ref-for-max-content-contribution\u2460"}],"title":"2.3. \nIntrinsic Size Constraints"},{"refs":[{"id":"ref-for-max-content-contribution\u2461"}],"title":"5.2. \nIntrinsic Contributions"},{"refs":[{"id":"ref-for-max-content-contribution\u2462"},{"id":"ref-for-max-content-contribution\u2463"},{"id":"ref-for-max-content-contribution\u2464"}],"title":"5.2.1. \nIntrinsic Contributions of Percentage-Sized Boxes"}],"url":"#max-content-contribution"}, "max-content-inline-size": {"dfnID":"max-content-inline-size","dfnText":"max-content inline size","external":false,"refSections":[{"refs":[{"id":"ref-for-max-content-inline-size"}],"title":"3.4. \nNew Column Sizing Values: the min-content, max-content, and fit-content() values"}],"url":"#max-content-inline-size"}, "max-height": {"dfnID":"max-height","dfnText":"maximum height","external":false,"refSections":[{"refs":[{"id":"ref-for-max-height"}],"title":"3.3. \nBox Edges for Sizing: the box-sizing property"}],"url":"#max-height"}, "max-size-properties": {"dfnID":"max-size-properties","dfnText":"3.1.3. \nMaximum Size Properties: the max-width and max-height properties","external":false,"refSections":[{"refs":[{"id":"ref-for-max-size-properties"}],"title":"3.1.3. \nMaximum Size Properties: the max-width and max-height properties"},{"refs":[{"id":"ref-for-max-size-properties"},{"id":"ref-for-max-size-properties\u2460"},{"id":"ref-for-max-size-properties\u2461"},{"id":"ref-for-max-size-properties\u2462"}],"title":"5.2.1. \nIntrinsic Contributions of Percentage-Sized Boxes"}],"url":"#max-size-properties"}, "max-width": {"dfnID":"max-width","dfnText":"maximum width","external":false,"refSections":[{"refs":[{"id":"ref-for-max-width"}],"title":"3.3. \nBox Edges for Sizing: the box-sizing property"},{"refs":[{"id":"ref-for-max-width\u2460"},{"id":"ref-for-max-width\u2461"}],"title":"5.1. \nIntrinsic Sizes"}],"url":"#max-width"}, "min-content": {"dfnID":"min-content","dfnText":"min-content size","external":false,"refSections":[{"refs":[{"id":"ref-for-min-content"},{"id":"ref-for-min-content\u2460"},{"id":"ref-for-min-content\u2461"},{"id":"ref-for-min-content\u2462"},{"id":"ref-for-min-content\u2463"},{"id":"ref-for-min-content\u2464"}],"title":"2.1. \nAuto Box Sizes"},{"refs":[{"id":"ref-for-min-content\u2465"}],"title":"2.2. \nIntrinsic Size Contributions"},{"refs":[{"id":"ref-for-min-content\u2466"}],"title":"3.2. \nSizing Values: the <length-percentage [0,\u221e]>, auto | none, min-content, max-content, and fit-content() values"},{"refs":[{"id":"ref-for-min-content\u2467"}],"title":"3.4. \nNew Column Sizing Values: the min-content, max-content, and fit-content() values"},{"refs":[{"id":"ref-for-min-content\u2468"},{"id":"ref-for-min-content\u2460\u24ea"},{"id":"ref-for-min-content\u2460\u2460"},{"id":"ref-for-min-content\u2460\u2461"},{"id":"ref-for-min-content\u2460\u2462"}],"title":"5.1. \nIntrinsic Sizes"}],"url":"#min-content"}, "min-content-block-size": {"dfnID":"min-content-block-size","dfnText":"min-content block size","external":false,"refSections":[],"url":"#min-content-block-size"}, "min-content-constraint": {"dfnID":"min-content-constraint","dfnText":"min-content constraint","external":false,"refSections":[{"refs":[{"id":"ref-for-min-content-constraint"}],"title":"2. \nTerminology"},{"refs":[{"id":"ref-for-min-content-constraint\u2460"},{"id":"ref-for-min-content-constraint\u2461"}],"title":"2.1. \nAuto Box Sizes"},{"refs":[{"id":"ref-for-min-content-constraint\u2462"}],"title":"\nRecent Changes"}],"url":"#min-content-constraint"}, "min-content-contribution": {"dfnID":"min-content-contribution","dfnText":"min-content contribution","external":false,"refSections":[{"refs":[{"id":"ref-for-min-content-contribution"}],"title":"2.2. \nIntrinsic Size Contributions"},{"refs":[{"id":"ref-for-min-content-contribution\u2460"}],"title":"2.3. \nIntrinsic Size Constraints"},{"refs":[{"id":"ref-for-min-content-contribution\u2461"}],"title":"5.2. \nIntrinsic Contributions"},{"refs":[{"id":"ref-for-min-content-contribution\u2462"},{"id":"ref-for-min-content-contribution\u2463"},{"id":"ref-for-min-content-contribution\u2464"},{"id":"ref-for-min-content-contribution\u2465"},{"id":"ref-for-min-content-contribution\u2466"},{"id":"ref-for-min-content-contribution\u2467"},{"id":"ref-for-min-content-contribution\u2468"}],"title":"5.2.1. \nIntrinsic Contributions of Percentage-Sized Boxes"},{"refs":[{"id":"ref-for-min-content-contribution\u2460\u24ea"}],"title":"5.2.2. \nCompressible Replaced Elements"}],"url":"#min-content-contribution"}, "min-content-inline-size": {"dfnID":"min-content-inline-size","dfnText":"min-content inline size","external":false,"refSections":[{"refs":[{"id":"ref-for-min-content-inline-size"}],"title":"3.4. \nNew Column Sizing Values: the min-content, max-content, and fit-content() values"}],"url":"#min-content-inline-size"}, "min-height": {"dfnID":"min-height","dfnText":"minimum height","external":false,"refSections":[{"refs":[{"id":"ref-for-min-height"}],"title":"3.3. \nBox Edges for Sizing: the box-sizing property"}],"url":"#min-height"}, "min-size-properties": {"dfnID":"min-size-properties","dfnText":"3.1.2. \nMinimum Size Properties: the min-width and min-height properties","external":false,"refSections":[{"refs":[{"id":"ref-for-min-size-properties"}],"title":"3.1.2. \nMinimum Size Properties: the min-width and min-height properties"},{"refs":[{"id":"ref-for-min-size-properties"}],"title":"5.1. \nIntrinsic Sizes"},{"refs":[{"id":"ref-for-min-size-properties\u2460"},{"id":"ref-for-min-size-properties\u2461"}],"title":"5.2.1. \nIntrinsic Contributions of Percentage-Sized Boxes"}],"url":"#min-size-properties"}, "min-width": {"dfnID":"min-width","dfnText":"minimum width","external":false,"refSections":[{"refs":[{"id":"ref-for-min-width"}],"title":"3.3. \nBox Edges for Sizing: the box-sizing property"},{"refs":[{"id":"ref-for-min-width\u2460"},{"id":"ref-for-min-width\u2461"},{"id":"ref-for-min-width\u2462"}],"title":"5.1. \nIntrinsic Sizes"},{"refs":[{"id":"ref-for-min-width\u2463"},{"id":"ref-for-min-width\u2464"},{"id":"ref-for-min-width\u2465"}],"title":"5.2.1. \nIntrinsic Contributions of Percentage-Sized Boxes"},{"refs":[{"id":"ref-for-min-width\u2466"}],"title":"\nRecent Changes"}],"url":"#min-width"}, "outer-size": {"dfnID":"outer-size","dfnText":"outer size","external":false,"refSections":[{"refs":[{"id":"ref-for-outer-size"}],"title":"2.1. \nAuto Box Sizes"},{"refs":[{"id":"ref-for-outer-size\u2460"}],"title":"2.2. \nIntrinsic Size Contributions"},{"refs":[{"id":"ref-for-outer-size\u2461"}],"title":"3.3. \nBox Edges for Sizing: the box-sizing property"}],"url":"#outer-size"}, "preferred-aspect-ratio": {"dfnID":"preferred-aspect-ratio","dfnText":"preferred aspect ratio","external":false,"refSections":[{"refs":[{"id":"ref-for-preferred-aspect-ratio"},{"id":"ref-for-preferred-aspect-ratio\u2460"}],"title":"2.3. \nIntrinsic Size Constraints"},{"refs":[{"id":"ref-for-preferred-aspect-ratio\u2461"}],"title":"3.2. \nSizing Values: the <length-percentage [0,\u221e]>, auto | none, min-content, max-content, and fit-content() values"},{"refs":[{"id":"ref-for-preferred-aspect-ratio\u2462"},{"id":"ref-for-preferred-aspect-ratio\u2463"},{"id":"ref-for-preferred-aspect-ratio\u2464"}],"title":"5.1. \nIntrinsic Sizes"},{"refs":[{"id":"ref-for-preferred-aspect-ratio\u2465"},{"id":"ref-for-preferred-aspect-ratio\u2466"}],"title":"5.2.1. \nIntrinsic Contributions of Percentage-Sized Boxes"},{"refs":[{"id":"ref-for-preferred-aspect-ratio\u2467"}],"title":"\nRecent Changes"}],"url":"#preferred-aspect-ratio"}, "preferred-size": {"dfnID":"preferred-size","dfnText":"preferred","external":false,"refSections":[{"refs":[{"id":"ref-for-preferred-size"},{"id":"ref-for-preferred-size\u2460"}],"title":"5.1. \nIntrinsic Sizes"}],"url":"#preferred-size"}, "preferred-size-properties": {"dfnID":"preferred-size-properties","dfnText":"3.1.1. \nPreferred Size Properties: the width and height properties","external":false,"refSections":[{"refs":[{"id":"ref-for-preferred-size-properties"}],"title":"3.1.1. \nPreferred Size Properties: the width and height properties"},{"refs":[{"id":"ref-for-preferred-size-properties"},{"id":"ref-for-preferred-size-properties\u2460"},{"id":"ref-for-preferred-size-properties\u2461"},{"id":"ref-for-preferred-size-properties\u2462"}],"title":"5.2.1. \nIntrinsic Contributions of Percentage-Sized Boxes"}],"url":"#preferred-size-properties"}, "propdef-box-sizing": {"dfnID":"propdef-box-sizing","dfnText":"box-sizing","external":false,"refSections":[{"refs":[{"id":"ref-for-propdef-box-sizing"}],"title":"1.1. \nModule interactions"},{"refs":[{"id":"ref-for-propdef-box-sizing\u2460"}],"title":"3.2. \nSizing Values: the <length-percentage [0,\u221e]>, auto | none, min-content, max-content, and fit-content() values"},{"refs":[{"id":"ref-for-propdef-box-sizing\u2461"},{"id":"ref-for-propdef-box-sizing\u2462"},{"id":"ref-for-propdef-box-sizing\u2463"},{"id":"ref-for-propdef-box-sizing\u2464"},{"id":"ref-for-propdef-box-sizing\u2465"}],"title":"3.3. \nBox Edges for Sizing: the box-sizing property"},{"refs":[{"id":"ref-for-propdef-box-sizing\u2466"},{"id":"ref-for-propdef-box-sizing\u2467"}],"title":"\nRecent Changes"},{"refs":[{"id":"ref-for-propdef-box-sizing\u2468"}],"title":"\nAdditions since CSS Level 2"}],"url":"#propdef-box-sizing"}, "propdef-height": {"dfnID":"propdef-height","dfnText":"height","external":false,"refSections":[{"refs":[{"id":"ref-for-propdef-height"}],"title":"1. \nIntroduction"},{"refs":[{"id":"ref-for-propdef-height\u2460"}],"title":"1.1. \nModule interactions"},{"refs":[{"id":"ref-for-propdef-height\u2461"},{"id":"ref-for-propdef-height\u2462"}],"title":"3.1. \nSizing Properties"},{"refs":[{"id":"ref-for-propdef-height\u2463"},{"id":"ref-for-propdef-height\u2464"}],"title":"3.1.1. \nPreferred Size Properties: the width and height properties"},{"refs":[{"id":"ref-for-propdef-height\u2465"}],"title":"3.1.2. \nMinimum Size Properties: the min-width and min-height properties"},{"refs":[{"id":"ref-for-propdef-height\u2466"}],"title":"3.1.3. \nMaximum Size Properties: the max-width and max-height properties"},{"refs":[{"id":"ref-for-propdef-height\u2467"}],"title":"3.2. \nSizing Values: the <length-percentage [0,\u221e]>, auto | none, min-content, max-content, and fit-content() values"},{"refs":[{"id":"ref-for-propdef-height\u2468"},{"id":"ref-for-propdef-height\u2460\u24ea"}],"title":"3.2.1. \n\u201cBehaving as auto\u201d"},{"refs":[{"id":"ref-for-propdef-height\u2460\u2460"},{"id":"ref-for-propdef-height\u2460\u2461"},{"id":"ref-for-propdef-height\u2460\u2462"}],"title":"3.3. \nBox Edges for Sizing: the box-sizing property"},{"refs":[{"id":"ref-for-propdef-height\u2460\u2463"},{"id":"ref-for-propdef-height\u2460\u2464"}],"title":"5.1. \nIntrinsic Sizes"},{"refs":[{"id":"ref-for-propdef-height\u2460\u2465"},{"id":"ref-for-propdef-height\u2460\u2466"},{"id":"ref-for-propdef-height\u2460\u2467"},{"id":"ref-for-propdef-height\u2460\u2468"},{"id":"ref-for-propdef-height\u2461\u24ea"},{"id":"ref-for-propdef-height\u2461\u2460"},{"id":"ref-for-propdef-height\u2461\u2461"}],"title":"5.2.1. \nIntrinsic Contributions of Percentage-Sized Boxes"},{"refs":[{"id":"ref-for-propdef-height\u2461\u2462"}],"title":"5.2.2. \nCompressible Replaced Elements"},{"refs":[{"id":"ref-for-propdef-height\u2461\u2463"}],"title":"\nRecent Changes"}],"url":"#propdef-height"}, "propdef-max-height": {"dfnID":"propdef-max-height","dfnText":"max-height","external":false,"refSections":[{"refs":[{"id":"ref-for-propdef-max-height"}],"title":"1.1. \nModule interactions"},{"refs":[{"id":"ref-for-propdef-max-height\u2460"}],"title":"3.1. \nSizing Properties"},{"refs":[{"id":"ref-for-propdef-max-height\u2461"},{"id":"ref-for-propdef-max-height\u2462"}],"title":"3.1.3. \nMaximum Size Properties: the max-width and max-height properties"},{"refs":[{"id":"ref-for-propdef-max-height\u2463"},{"id":"ref-for-propdef-max-height\u2464"}],"title":"5.2.1. \nIntrinsic Contributions of Percentage-Sized Boxes"},{"refs":[{"id":"ref-for-propdef-max-height\u2465"}],"title":"5.2.2. \nCompressible Replaced Elements"},{"refs":[{"id":"ref-for-propdef-max-height\u2466"}],"title":"\nRecent Changes"}],"url":"#propdef-max-height"}, "propdef-max-width": {"dfnID":"propdef-max-width","dfnText":"max-width","external":false,"refSections":[{"refs":[{"id":"ref-for-propdef-max-width"}],"title":"1.1. \nModule interactions"},{"refs":[{"id":"ref-for-propdef-max-width\u2460"}],"title":"3.1. \nSizing Properties"},{"refs":[{"id":"ref-for-propdef-max-width\u2461"},{"id":"ref-for-propdef-max-width\u2462"}],"title":"3.1.3. \nMaximum Size Properties: the max-width and max-height properties"},{"refs":[{"id":"ref-for-propdef-max-width\u2463"},{"id":"ref-for-propdef-max-width\u2464"}],"title":"5.2.1. \nIntrinsic Contributions of Percentage-Sized Boxes"},{"refs":[{"id":"ref-for-propdef-max-width\u2465"}],"title":"5.2.2. \nCompressible Replaced Elements"}],"url":"#propdef-max-width"}, "propdef-min-height": {"dfnID":"propdef-min-height","dfnText":"min-height","external":false,"refSections":[{"refs":[{"id":"ref-for-propdef-min-height"}],"title":"1.1. \nModule interactions"},{"refs":[{"id":"ref-for-propdef-min-height\u2460"}],"title":"3.1. \nSizing Properties"},{"refs":[{"id":"ref-for-propdef-min-height\u2461"},{"id":"ref-for-propdef-min-height\u2462"}],"title":"3.1.2. \nMinimum Size Properties: the min-width and min-height properties"},{"refs":[{"id":"ref-for-propdef-min-height\u2463"}],"title":"3.2. \nSizing Values: the <length-percentage [0,\u221e]>, auto | none, min-content, max-content, and fit-content() values"},{"refs":[{"id":"ref-for-propdef-min-height\u2464"},{"id":"ref-for-propdef-min-height\u2465"}],"title":"5.1. \nIntrinsic Sizes"},{"refs":[{"id":"ref-for-propdef-min-height\u2466"},{"id":"ref-for-propdef-min-height\u2467"},{"id":"ref-for-propdef-min-height\u2468"}],"title":"5.2.1. \nIntrinsic Contributions of Percentage-Sized Boxes"},{"refs":[{"id":"ref-for-propdef-min-height\u2460\u24ea"}],"title":"\nRecent Changes"},{"refs":[{"id":"ref-for-propdef-min-height\u2460\u2460"}],"title":"\nAdditions since CSS Level 2"}],"url":"#propdef-min-height"}, "propdef-min-width": {"dfnID":"propdef-min-width","dfnText":"min-width","external":false,"refSections":[{"refs":[{"id":"ref-for-propdef-min-width"}],"title":"1.1. \nModule interactions"},{"refs":[{"id":"ref-for-propdef-min-width\u2460"}],"title":"3.1. \nSizing Properties"},{"refs":[{"id":"ref-for-propdef-min-width\u2461"},{"id":"ref-for-propdef-min-width\u2462"}],"title":"3.1.2. \nMinimum Size Properties: the min-width and min-height properties"},{"refs":[{"id":"ref-for-propdef-min-width\u2463"}],"title":"3.2. \nSizing Values: the <length-percentage [0,\u221e]>, auto | none, min-content, max-content, and fit-content() values"},{"refs":[{"id":"ref-for-propdef-min-width\u2464"},{"id":"ref-for-propdef-min-width\u2465"}],"title":"5.1. \nIntrinsic Sizes"},{"refs":[{"id":"ref-for-propdef-min-width\u2466"}],"title":"\nRecent Changes"},{"refs":[{"id":"ref-for-propdef-min-width\u2467"}],"title":"\nAdditions since CSS Level 2"}],"url":"#propdef-min-width"}, "propdef-width": {"dfnID":"propdef-width","dfnText":"width","external":false,"refSections":[{"refs":[{"id":"ref-for-propdef-width"}],"title":"1. \nIntroduction"},{"refs":[{"id":"ref-for-propdef-width\u2460"}],"title":"1.1. \nModule interactions"},{"refs":[{"id":"ref-for-propdef-width\u2461"},{"id":"ref-for-propdef-width\u2462"}],"title":"3.1. \nSizing Properties"},{"refs":[{"id":"ref-for-propdef-width\u2463"},{"id":"ref-for-propdef-width\u2464"}],"title":"3.1.1. \nPreferred Size Properties: the width and height properties"},{"refs":[{"id":"ref-for-propdef-width\u2465"}],"title":"3.1.2. \nMinimum Size Properties: the min-width and min-height properties"},{"refs":[{"id":"ref-for-propdef-width\u2466"}],"title":"3.1.3. \nMaximum Size Properties: the max-width and max-height properties"},{"refs":[{"id":"ref-for-propdef-width\u2467"},{"id":"ref-for-propdef-width\u2468"}],"title":"3.2. \nSizing Values: the <length-percentage [0,\u221e]>, auto | none, min-content, max-content, and fit-content() values"},{"refs":[{"id":"ref-for-propdef-width\u2460\u24ea"},{"id":"ref-for-propdef-width\u2460\u2460"}],"title":"3.2.1. \n\u201cBehaving as auto\u201d"},{"refs":[{"id":"ref-for-propdef-width\u2460\u2461"},{"id":"ref-for-propdef-width\u2460\u2462"},{"id":"ref-for-propdef-width\u2460\u2463"},{"id":"ref-for-propdef-width\u2460\u2464"}],"title":"3.3. \nBox Edges for Sizing: the box-sizing property"},{"refs":[{"id":"ref-for-propdef-width\u2460\u2465"},{"id":"ref-for-propdef-width\u2460\u2466"}],"title":"5.1. \nIntrinsic Sizes"},{"refs":[{"id":"ref-for-propdef-width\u2460\u2467"},{"id":"ref-for-propdef-width\u2460\u2468"},{"id":"ref-for-propdef-width\u2461\u24ea"},{"id":"ref-for-propdef-width\u2461\u2460"},{"id":"ref-for-propdef-width\u2461\u2461"},{"id":"ref-for-propdef-width\u2461\u2462"}],"title":"5.2.1. \nIntrinsic Contributions of Percentage-Sized Boxes"},{"refs":[{"id":"ref-for-propdef-width\u2461\u2463"}],"title":"5.2.2. \nCompressible Replaced Elements"},{"refs":[{"id":"ref-for-propdef-width\u2461\u2464"}],"title":"\nRecent Changes"}],"url":"#propdef-width"}, "size": {"dfnID":"size","dfnText":"size","external":false,"refSections":[{"refs":[{"id":"ref-for-size"},{"id":"ref-for-size\u2460"}],"title":"2. \nTerminology"},{"refs":[{"id":"ref-for-size\u2461"},{"id":"ref-for-size\u2462"},{"id":"ref-for-size\u2463"},{"id":"ref-for-size\u2464"},{"id":"ref-for-size\u2465"},{"id":"ref-for-size\u2466"},{"id":"ref-for-size\u2467"}],"title":"2.1. \nAuto Box Sizes"}],"url":"#size"}, "sizing-property": {"dfnID":"sizing-property","dfnText":"sizing properties","external":false,"refSections":[{"refs":[{"id":"ref-for-sizing-property"},{"id":"ref-for-sizing-property\u2460"},{"id":"ref-for-sizing-property\u2461"},{"id":"ref-for-sizing-property\u2462"}],"title":"3.3. \nBox Edges for Sizing: the box-sizing property"},{"refs":[{"id":"ref-for-sizing-property\u2463"}],"title":"5.1. \nIntrinsic Sizes"},{"refs":[{"id":"ref-for-sizing-property\u2464"}],"title":"\nAdditions since CSS Level 2"}],"url":"#sizing-property"}, "stretch-fit": {"dfnID":"stretch-fit","dfnText":"stretch fit","external":false,"refSections":[{"refs":[{"id":"ref-for-stretch-fit"}],"title":"2. \nTerminology"},{"refs":[{"id":"ref-for-stretch-fit\u2460"}],"title":"2.1. \nAuto Box Sizes"},{"refs":[{"id":"ref-for-stretch-fit\u2461"}],"title":"5.1. \nIntrinsic Sizes"}],"url":"#stretch-fit"}, "stretch-fit-block-size": {"dfnID":"stretch-fit-block-size","dfnText":"stretch-fit block size","external":false,"refSections":[],"url":"#stretch-fit-block-size"}, "stretch-fit-inline-size": {"dfnID":"stretch-fit-inline-size","dfnText":"stretch-fit inline size","external":false,"refSections":[],"url":"#stretch-fit-inline-size"}, "stretch-fit-size": {"dfnID":"stretch-fit-size","dfnText":"stretch-fit size","external":false,"refSections":[{"refs":[{"id":"ref-for-stretch-fit-size"},{"id":"ref-for-stretch-fit-size\u2460"}],"title":"2.1. \nAuto Box Sizes"},{"refs":[{"id":"ref-for-stretch-fit-size\u2461"}],"title":"3.2. \nSizing Values: the <length-percentage [0,\u221e]>, auto | none, min-content, max-content, and fit-content() values"}],"url":"#stretch-fit-size"}, "valdef-box-sizing-border-box": {"dfnID":"valdef-box-sizing-border-box","dfnText":"border-box","external":false,"refSections":[{"refs":[{"id":"ref-for-valdef-box-sizing-border-box"},{"id":"ref-for-valdef-box-sizing-border-box\u2460"}],"title":"3.3. \nBox Edges for Sizing: the box-sizing property"}],"url":"#valdef-box-sizing-border-box"}, "valdef-box-sizing-content-box": {"dfnID":"valdef-box-sizing-content-box","dfnText":"content-box","external":false,"refSections":[],"url":"#valdef-box-sizing-content-box"}, "valdef-column-width-fit-content-length-percentage": {"dfnID":"valdef-column-width-fit-content-length-percentage","dfnText":"fit-content(<length-percentage>)","external":false,"refSections":[{"refs":[{"id":"ref-for-valdef-column-width-fit-content-length-percentage"}],"title":"3.4. \nNew Column Sizing Values: the min-content, max-content, and fit-content() values"}],"url":"#valdef-column-width-fit-content-length-percentage"}, "valdef-column-width-max-content": {"dfnID":"valdef-column-width-max-content","dfnText":"max-content","external":false,"refSections":[{"refs":[{"id":"ref-for-valdef-column-width-max-content"}],"title":"3.4. \nNew Column Sizing Values: the min-content, max-content, and fit-content() values"}],"url":"#valdef-column-width-max-content"}, "valdef-column-width-min-content": {"dfnID":"valdef-column-width-min-content","dfnText":"min-content","external":false,"refSections":[{"refs":[{"id":"ref-for-valdef-column-width-min-content"}],"title":"3.4. \nNew Column Sizing Values: the min-content, max-content, and fit-content() values"}],"url":"#valdef-column-width-min-content"}, "valdef-max-width-none": {"dfnID":"valdef-max-width-none","dfnText":"none","external":false,"refSections":[{"refs":[{"id":"ref-for-valdef-max-width-none"},{"id":"ref-for-valdef-max-width-none\u2460"}],"title":"3.2. \nSizing Values: the <length-percentage [0,\u221e]>, auto | none, min-content, max-content, and fit-content() values"}],"url":"#valdef-max-width-none"}, "valdef-width-auto": {"dfnID":"valdef-width-auto","dfnText":"auto","external":false,"refSections":[{"refs":[{"id":"ref-for-valdef-width-auto"}],"title":"2. \nTerminology"},{"refs":[{"id":"ref-for-valdef-width-auto\u2460"}],"title":"2.1. \nAuto Box Sizes"},{"refs":[{"id":"ref-for-valdef-width-auto\u2461"}],"title":"3.1.2. \nMinimum Size Properties: the min-width and min-height properties"},{"refs":[{"id":"ref-for-valdef-width-auto\u2462"}],"title":"3.2. \nSizing Values: the <length-percentage [0,\u221e]>, auto | none, min-content, max-content, and fit-content() values"},{"refs":[{"id":"ref-for-valdef-width-auto\u2463"},{"id":"ref-for-valdef-width-auto\u2464"},{"id":"ref-for-valdef-width-auto\u2465"},{"id":"ref-for-valdef-width-auto\u2466"}],"title":"3.2.1. \n\u201cBehaving as auto\u201d"},{"refs":[{"id":"ref-for-valdef-width-auto\u2467"}],"title":"3.3. \nBox Edges for Sizing: the box-sizing property"},{"refs":[{"id":"ref-for-valdef-width-auto\u2468"},{"id":"ref-for-valdef-width-auto\u2460\u24ea"},{"id":"ref-for-valdef-width-auto\u2460\u2460"},{"id":"ref-for-valdef-width-auto\u2460\u2461"},{"id":"ref-for-valdef-width-auto\u2460\u2462"}],"title":"5.1. \nIntrinsic Sizes"},{"refs":[{"id":"ref-for-valdef-width-auto\u2460\u2463"}],"title":"5.2. \nIntrinsic Contributions"},{"refs":[{"id":"ref-for-valdef-width-auto\u2460\u2464"},{"id":"ref-for-valdef-width-auto\u2460\u2465"},{"id":"ref-for-valdef-width-auto\u2460\u2466"}],"title":"5.2.1. \nIntrinsic Contributions of Percentage-Sized Boxes"},{"refs":[{"id":"ref-for-valdef-width-auto\u2460\u2467"}],"title":"\nRecent Changes"},{"refs":[{"id":"ref-for-valdef-width-auto\u2460\u2468"}],"title":"\nAdditions since CSS Level 2"}],"url":"#valdef-width-auto"}, "valdef-width-length-percentage-0": {"dfnID":"valdef-width-length-percentage-0","dfnText":"<length-percentage [0,\u221e]>","external":false,"refSections":[],"url":"#valdef-width-length-percentage-0"}, "valdef-width-max-content": {"dfnID":"valdef-width-max-content","dfnText":"max-content","external":false,"refSections":[{"refs":[{"id":"ref-for-valdef-width-max-content"}],"title":"2. \nTerminology"},{"refs":[{"id":"ref-for-valdef-width-max-content\u2460"},{"id":"ref-for-valdef-width-max-content\u2461"},{"id":"ref-for-valdef-width-max-content\u2462"}],"title":"3.2. \nSizing Values: the <length-percentage [0,\u221e]>, auto | none, min-content, max-content, and fit-content() values"},{"refs":[{"id":"ref-for-valdef-width-max-content\u2463"}],"title":"5.1. \nIntrinsic Sizes"},{"refs":[{"id":"ref-for-valdef-width-max-content\u2464"}],"title":"\nRecent Changes"},{"refs":[{"id":"ref-for-valdef-width-max-content\u2465"}],"title":"\nAdditions since CSS Level 2"}],"url":"#valdef-width-max-content"}, "valdef-width-min-content": {"dfnID":"valdef-width-min-content","dfnText":"min-content","external":false,"refSections":[{"refs":[{"id":"ref-for-valdef-width-min-content"},{"id":"ref-for-valdef-width-min-content\u2460"},{"id":"ref-for-valdef-width-min-content\u2461"}],"title":"3.2. \nSizing Values: the <length-percentage [0,\u221e]>, auto | none, min-content, max-content, and fit-content() values"},{"refs":[{"id":"ref-for-valdef-width-min-content\u2462"}],"title":"3.3. \nBox Edges for Sizing: the box-sizing property"},{"refs":[{"id":"ref-for-valdef-width-min-content\u2463"}],"title":"5.1. \nIntrinsic Sizes"},{"refs":[{"id":"ref-for-valdef-width-min-content\u2464"}],"title":"5.2.1. \nIntrinsic Contributions of Percentage-Sized Boxes"},{"refs":[{"id":"ref-for-valdef-width-min-content\u2465"}],"title":"\nRecent Changes"},{"refs":[{"id":"ref-for-valdef-width-min-content\u2466"}],"title":"\nAdditions since CSS Level 2"}],"url":"#valdef-width-min-content"}, "width": {"dfnID":"width","dfnText":"width","external":false,"refSections":[{"refs":[{"id":"ref-for-width"},{"id":"ref-for-width\u2460"}],"title":"2. \nTerminology"},{"refs":[{"id":"ref-for-width\u2461"}],"title":"3.3. \nBox Edges for Sizing: the box-sizing property"}],"url":"#width"}, }; document.addEventListener("DOMContentLoaded", ()=>{ genAllDfnPanels(); document.body.addEventListener("click", (e) => { // If not handled already, just hide all dfn panels. hideAllDfnPanels(); }); }); window.addEventListener("resize", () => { // Pin any visible dfn panel queryAll(".dfn-panel.on, .dfn-panel.activated").forEach(el=>positionDfnPanel(el)); }); function genAllDfnPanels() { for(const panelData of Object.values(dfnPanelData)) { const dfnID = panelData.dfnID; const dfn = document.getElementById(dfnID); if(!dfn) { console.log(`Can't find dfn#${dfnID}.`, panelData); continue; } dfn.panelData = panelData; insertDfnPopupAction(dfn); } } function genDfnPanel(dfn, { dfnID, url, dfnText, refSections, external }) { const dfnPanel = mk.aside({ class: "dfn-panel on", id: `infopanel-for-${dfnID}`, "data-for": dfnID, "aria-labelled-by":`infopaneltitle-for-${dfnID}`, }, mk.span({id:`infopaneltitle-for-${dfnID}`, style:"display:none"}, `Info about the '${dfnText}' ${external?"external":""} reference.`), mk.a({href:url, class:"dfn-link"}, url), refSections.length == 0 ? [] : mk.b({}, "Referenced in:"), mk.ul({}, ...refSections.map(section=> mk.li({}, ...section.refs.map((ref, refI)=> [ mk.a({ href: `#${ref.id}` }, (refI == 0) ? section.title : `(${refI + 1})` ), " ", ] ), ), ), ), genLinkingSyntaxes(dfn), ); dfnPanel.addEventListener('click', (event) => { if (event.target.nodeName == 'A') { scrollToTargetAndHighlight(event); pinDfnPanel(dfnPanel); } event.stopPropagation(); refocusOnTarget(event); }); dfnPanel.addEventListener('keydown', (event) => { if(event.keyCode == 27) { // Escape key hideDfnPanel({dfnPanel}); event.stopPropagation(); event.preventDefault(); } }); dfnPanel.dfn = dfn; dfn.dfnPanel = dfnPanel; return dfnPanel; } function hideAllDfnPanels() { // Delete the currently-active dfn panel. queryAll(".dfn-panel").forEach(dfnPanel=>hideDfnPanel({dfnPanel})); } function showDfnPanel(dfn) { hideAllDfnPanels(); // Only display one at a time. dfn.setAttribute("aria-expanded", "true"); const dfnPanel = genDfnPanel(dfn, dfn.panelData); // Give the dfn a unique tabindex, and then // give all the tabbable panel bits successive indexes. let tabIndex = 100; dfn.tabIndex = tabIndex++; const tabbable = dfnPanel.querySelectorAll(":is(a, button)"); for (const el of tabbable) { el.tabIndex = tabIndex++; } append(document.body, dfnPanel); positionDfnPanel(dfnPanel); } function positionDfnPanel(dfnPanel) { const dfn = dfnPanel.dfn; const dfnPos = getBounds(dfn); dfnPanel.style.top = dfnPos.bottom + "px"; dfnPanel.style.left = dfnPos.left + "px"; const panelPos = dfnPanel.getBoundingClientRect(); const panelMargin = 8; const maxRight = document.body.parentNode.clientWidth - panelMargin; if (panelPos.right > maxRight) { const overflowAmount = panelPos.right - maxRight; const newLeft = Math.max(panelMargin, dfnPos.left - overflowAmount); dfnPanel.style.left = newLeft + "px"; } } function pinDfnPanel(dfnPanel) { // Switch it to "activated" state, which pins it. dfnPanel.classList.add("activated"); dfnPanel.style.position = "fixed"; dfnPanel.style.left = null; dfnPanel.style.top = null; } function hideDfnPanel({dfn, dfnPanel}) { if(!dfnPanel) dfnPanel = dfn.dfnPanel; if(!dfn) dfn = dfnPanel.dfn; dfn.dfnPanel = undefined; dfnPanel.dfn = undefined; dfn.setAttribute("aria-expanded", "false"); dfn.tabIndex = undefined; dfnPanel.remove() } function toggleDfnPanel(dfn) { if(dfn.dfnPanel) { hideDfnPanel(dfn); } else { showDfnPanel(dfn); } } function insertDfnPopupAction(dfn) { dfn.setAttribute('role', 'button'); dfn.setAttribute('aria-expanded', 'false') dfn.tabIndex = 0; dfn.classList.add('has-dfn-panel'); dfn.addEventListener('click', (event) => { toggleDfnPanel(dfn); event.stopPropagation(); }); dfn.addEventListener('keypress', (event) => { const kc = event.keyCode; // 32->Space, 13->Enter if(kc == 32 || kc == 13) { toggleDfnPanel(dfn); event.stopPropagation(); event.preventDefault(); } }); } function refocusOnTarget(event) { const target = event.target; setTimeout(() => { // Refocus on the event.target element. // This is needed after browser scrolls to the destination. target.focus(); }); } // TODO: shared util // Returns the root-level absolute position {left and top} of element. function getBounds(el, relativeTo=document.body) { const relativeRect = relativeTo.getBoundingClientRect(); const elRect = el.getBoundingClientRect(); const top = elRect.top - relativeRect.top; const left = elRect.left - relativeRect.left; return { top, left, bottom: top + elRect.height, right: left + elRect.width, } } function scrollToTargetAndHighlight(event) { let hash = event.target.hash; if (hash) { hash = decodeURIComponent(hash.substring(1)); const dest = document.getElementById(hash); if (dest) { dest.classList.add('highlighted'); setTimeout(() => dest.classList.remove('highlighted'), 1000); } } } // Functions, divided by link type, that wrap an autolink's // contents with the appropriate outer syntax. // Alternately, a string naming another type they format // the same as. function needsFor(type) { switch(type) { case "descriptor": case "value": case "element-attr": case "attr-value": case "element-state": case "method": case "constructor": case "argument": case "attribute": case "const": case "dict-member": case "event": case "enum-value": case "stringifier": case "serializer": case "iterator": case "maplike": case "setlike": case "state": case "mode": case "context": case "facet": return true; default: return false; } } function refusesFor(type) { switch(type) { case "property": case "element": case "interface": case "namespace": case "callback": case "dictionary": case "enum": case "exception": case "typedef": case "http-header": case "permission": return true; default: return false; } } function linkFormatterFromType(type) { switch(type) { case 'scheme': case 'permission': case 'dfn': return (text) => `[=${text}=]`; case 'abstract-op': return (text) => `[\$${text}\$]`; case 'function': case 'at-rule': case 'selector': case 'value': return (text) => `''${text}''`; case 'http-header': return (text) => `[:${text}:]`; case 'interface': case 'constructor': case 'method': case 'argument': case 'attribute': case 'callback': case 'dictionary': case 'dict-member': case 'enum': case 'enum-value': case 'exception': case 'const': case 'typedef': case 'stringifier': case 'serializer': case 'iterator': case 'maplike': case 'setlike': case 'extended-attribute': case 'event': case 'idl': return (text) => `{{${text}}}`; case 'element-state': case 'element-attr': case 'attr-value': case 'element': return (element) => `<{${element}}>`; case 'grammar': return (text) => `${text} (within a <pre class=prod>)`; case 'type': return (text)=> `<<${text}>>`; case 'descriptor': case 'property': return (text) => `'${text}'`; default: return; }; }; function genLinkingSyntaxes(dfn) { if(dfn.tagName != "DFN") return; const type = dfn.getAttribute('data-dfn-type'); if(!type) { console.log(`<dfn> doesn't have a data-dfn-type:`, dfn); return []; } // Return a function that wraps link text based on the type const linkFormatter = linkFormatterFromType(type); if(!linkFormatter) { console.log(`<dfn> has an unknown data-dfn-type:`, dfn); return []; } let ltAlts; if(dfn.hasAttribute('data-lt')) { ltAlts = dfn.getAttribute('data-lt') .split("|") .map(x=>x.trim()); } else { ltAlts = [dfn.textContent.trim()]; } if(type == "type") { // lt of "<foo>", but "foo" is the interior; // <<foo/bar>> is how you write it with a for, // not <foo/<bar>> or whatever. for(var i = 0; i < ltAlts.length; i++) { const lt = ltAlts[i]; const match = /<(.*)>/.exec(lt); if(match) { ltAlts[i] = match[1]; } } } let forAlts; if(dfn.hasAttribute('data-dfn-for')) { forAlts = dfn.getAttribute('data-dfn-for') .split(",") .map(x=>x.trim()); } else { forAlts = ['']; } let linkingSyntaxes = []; if(!needsFor(type)) { for(const lt of ltAlts) { linkingSyntaxes.push(linkFormatter(lt)); } } if(!refusesFor(type)) { for(const f of forAlts) { linkingSyntaxes.push(linkFormatter(`${f}/${ltAlts[0]}`)) } } return [ mk.b({}, 'Possible linking syntaxes:'), mk.ul({}, ...linkingSyntaxes.map(link => { const copyLink = async () => await navigator.clipboard.writeText(link); return mk.li({}, mk.div({ class: 'link-item' }, mk.button({ class: 'copy-icon', title: 'Copy', type: 'button', _onclick: copyLink, tabindex: 0, }, mk.span({ class: 'icon' }) ), mk.span({}, link) ) ); }) ) ]; } } </script> <script>/* Boilerplate: script-link-titles */ "use strict"; { let linkTitleData = { "https://drafts.csswg.org/css-values-4/#length-value": "Expands to: advance measure | cap | ch | cm | dvb | dvh | dvi | dvmax | dvmin | dvw | em | ex | ic | in | lh | lvb | lvh | lvi | lvmax | lvmin | lvw | mm | pc | pt | px | rcap | rch | rem | rex | ric | rlh | svb | svh | svi | svmax | svmin | svw | vb | vh | vi | vmax | vmin | vw", }; function setTypeTitles() { for(let el of document.querySelectorAll("a[href]")) { if(el.href in linkTitleData && !el.hasAttribute("title")) { el.setAttribute("title", linkTitleData[el.href]); } } } document.addEventListener("DOMContentLoaded", setTypeTitles); } </script> <script>/* Boilerplate: script-position-annos */ "use strict"; { function repositionAnnoPanels(){ const panels = [...document.querySelectorAll("[data-anno-for]")]; hydratePanels(panels); let vSoFar = 0; for(const panel of panels.sort(cmpTops)) { if(panel.top < vSoFar) { panel.top = vSoFar; panel.style.top = vSoFar + "px"; } vSoFar = panel.top + panel.height + 15; } } function hydratePanels(panels) { const main = document.querySelector("main"); let mainRect; if(main) mainRect = main.getBoundingClientRect(); // First display them all, if they're not already visible. for(const panel of panels) { panel.classList.remove("unpositioned"); } // Measure them all for(const panel of panels) { const dfn = document.getElementById(panel.getAttribute("data-anno-for")); if(!dfn) { console.log("Can't find the annotation panel target:", panel); continue; } panel.dfn = dfn; panel.top = window.scrollY + dfn.getBoundingClientRect().top; let panelRect = panel.getBoundingClientRect(); panel.height = panelRect.height; if(main) { panel.overlappingMain = panelRect.left < mainRect.right; } else { panel.overlappingMain = false; } } // And finally position them for(const panel of panels) { const dfn = panel.dfn; if(!dfn) continue; panel.style.top = panel.top + "px"; panel.classList.toggle("overlapping-main", panel.overlappingMain); } } function cmpTops(a,b) { return a.top - b.top; } window.addEventListener("load", repositionAnnoPanels); window.addEventListener("resize", repositionAnnoPanels); } </script> <script>/* Boilerplate: script-ref-hints */ "use strict"; { let refsData = { "#automatic-minimum-size": {"displayText":"automatic minimum size","export":true,"for_":[],"level":"3","normative":true,"shortname":"css-sizing","spec":"css-sizing-3","status":"local","text":"automatic minimum size","type":"dfn","url":"#automatic-minimum-size"}, "#automatic-size": {"displayText":"automatic size","export":true,"for_":[],"level":"3","normative":true,"shortname":"css-sizing","spec":"css-sizing-3","status":"local","text":"automatic size","type":"dfn","url":"#automatic-size"}, "#available": {"displayText":"available space","export":true,"for_":[],"level":"3","normative":true,"shortname":"css-sizing","spec":"css-sizing-3","status":"local","text":"available space","type":"dfn","url":"#available"}, "#behave-as-auto": {"displayText":"behaves as auto","export":true,"for_":[],"level":"3","normative":true,"shortname":"css-sizing","spec":"css-sizing-3","status":"local","text":"behaves as auto","type":"dfn","url":"#behave-as-auto"}, "#cyclic-percentage-size": {"displayText":"cyclic percentage","export":true,"for_":[],"level":"3","normative":true,"shortname":"css-sizing","spec":"css-sizing-3","status":"local","text":"cyclic percentage","type":"dfn","url":"#cyclic-percentage-size"}, "#definite": {"displayText":"definite","export":true,"for_":[],"level":"3","normative":true,"shortname":"css-sizing","spec":"css-sizing-3","status":"local","text":"definite","type":"dfn","url":"#definite"}, "#fallback": {"displayText":"fallback size","export":true,"for_":[],"level":"3","normative":true,"shortname":"css-sizing","spec":"css-sizing-3","status":"local","text":"fallback size","type":"dfn","url":"#fallback"}, "#fit-content-size": {"displayText":"fit-content size","export":true,"for_":[],"level":"3","normative":true,"shortname":"css-sizing","spec":"css-sizing-3","status":"local","text":"fit-content size","type":"dfn","url":"#fit-content-size"}, "#funcdef-width-calc-size": {"displayText":"calc-size()","export":true,"for_":["height","max-height","max-width","min-height","min-width","width"],"level":"3","normative":true,"shortname":"css-sizing","spec":"css-sizing-3","status":"local","text":"calc-size()","type":"function","url":"#funcdef-width-calc-size"}, "#funcdef-width-fit-content": {"displayText":"fit-content()","export":true,"for_":["height","max-height","max-width","min-height","min-width","width"],"level":"3","normative":true,"shortname":"css-sizing","spec":"css-sizing-3","status":"local","text":"fit-content()","type":"function","url":"#funcdef-width-fit-content"}, "#height": {"displayText":"height","export":true,"for_":[],"level":"3","normative":true,"shortname":"css-sizing","spec":"css-sizing-3","status":"local","text":"height","type":"dfn","url":"#height"}, "#indefinite": {"displayText":"indefinite","export":true,"for_":[],"level":"3","normative":true,"shortname":"css-sizing","spec":"css-sizing-3","status":"local","text":"indefinite","type":"dfn","url":"#indefinite"}, "#inner-size": {"displayText":"inner size","export":true,"for_":[],"level":"3","normative":true,"shortname":"css-sizing","spec":"css-sizing-3","status":"local","text":"inner size","type":"dfn","url":"#inner-size"}, "#intrinsic-size": {"displayText":"intrinsic size","export":true,"for_":[],"level":"3","normative":true,"shortname":"css-sizing","spec":"css-sizing-3","status":"local","text":"intrinsic size","type":"dfn","url":"#intrinsic-size"}, "#intrinsic-size-contribution": {"displayText":"intrinsic size contribution","export":true,"for_":[],"level":"3","normative":true,"shortname":"css-sizing","spec":"css-sizing-3","status":"local","text":"intrinsic size contribution","type":"dfn","url":"#intrinsic-size-contribution"}, "#intrinsic-sizing": {"displayText":"intrinsic sizing","export":true,"for_":[],"level":"3","normative":true,"shortname":"css-sizing","spec":"css-sizing-3","status":"local","text":"intrinsic sizing","type":"dfn","url":"#intrinsic-sizing"}, "#max-content": {"displayText":"max-content size","export":true,"for_":[],"level":"3","normative":true,"shortname":"css-sizing","spec":"css-sizing-3","status":"local","text":"max-content size","type":"dfn","url":"#max-content"}, "#max-content-block-size": {"displayText":"max-content block size","export":true,"for_":[],"level":"3","normative":true,"shortname":"css-sizing","spec":"css-sizing-3","status":"local","text":"max-content block size","type":"dfn","url":"#max-content-block-size"}, "#max-content-constraint": {"displayText":"max-content constraint","export":true,"for_":[],"level":"3","normative":true,"shortname":"css-sizing","spec":"css-sizing-3","status":"local","text":"max-content constraint","type":"dfn","url":"#max-content-constraint"}, "#max-content-contribution": {"displayText":"max-content contribution","export":true,"for_":[],"level":"3","normative":true,"shortname":"css-sizing","spec":"css-sizing-3","status":"local","text":"max-content contribution","type":"dfn","url":"#max-content-contribution"}, "#max-content-inline-size": {"displayText":"max-content inline size","export":true,"for_":[],"level":"3","normative":true,"shortname":"css-sizing","spec":"css-sizing-3","status":"local","text":"max-content inline size","type":"dfn","url":"#max-content-inline-size"}, "#max-height": {"displayText":"max height","export":true,"for_":[],"level":"3","normative":true,"shortname":"css-sizing","spec":"css-sizing-3","status":"local","text":"max height","type":"dfn","url":"#max-height"}, "#max-size-properties": {"displayText":"max size property","export":true,"for_":[],"level":"3","normative":true,"shortname":"css-sizing","spec":"css-sizing-3","status":"local","text":"max size property","type":"dfn","url":"#max-size-properties"}, "#max-width": {"displayText":"max width","export":true,"for_":[],"level":"3","normative":true,"shortname":"css-sizing","spec":"css-sizing-3","status":"local","text":"max width","type":"dfn","url":"#max-width"}, "#min-content": {"displayText":"min-content size","export":true,"for_":[],"level":"3","normative":true,"shortname":"css-sizing","spec":"css-sizing-3","status":"local","text":"min-content size","type":"dfn","url":"#min-content"}, "#min-content-constraint": {"displayText":"min-content constraint","export":true,"for_":[],"level":"3","normative":true,"shortname":"css-sizing","spec":"css-sizing-3","status":"local","text":"min-content constraint","type":"dfn","url":"#min-content-constraint"}, "#min-content-contribution": {"displayText":"min-content contribution","export":true,"for_":[],"level":"3","normative":true,"shortname":"css-sizing","spec":"css-sizing-3","status":"local","text":"min-content contribution","type":"dfn","url":"#min-content-contribution"}, "#min-content-inline-size": {"displayText":"min-content inline size","export":true,"for_":[],"level":"3","normative":true,"shortname":"css-sizing","spec":"css-sizing-3","status":"local","text":"min-content inline size","type":"dfn","url":"#min-content-inline-size"}, "#min-height": {"displayText":"min height","export":true,"for_":[],"level":"3","normative":true,"shortname":"css-sizing","spec":"css-sizing-3","status":"local","text":"min height","type":"dfn","url":"#min-height"}, "#min-size-properties": {"displayText":"min size property","export":true,"for_":[],"level":"3","normative":true,"shortname":"css-sizing","spec":"css-sizing-3","status":"local","text":"min size property","type":"dfn","url":"#min-size-properties"}, "#min-width": {"displayText":"min width","export":true,"for_":[],"level":"3","normative":true,"shortname":"css-sizing","spec":"css-sizing-3","status":"local","text":"min width","type":"dfn","url":"#min-width"}, "#outer-size": {"displayText":"outer size","export":true,"for_":[],"level":"3","normative":true,"shortname":"css-sizing","spec":"css-sizing-3","status":"local","text":"outer size","type":"dfn","url":"#outer-size"}, "#preferred-aspect-ratio": {"displayText":"preferred aspect ratio","export":true,"for_":[],"level":"3","normative":true,"shortname":"css-sizing","spec":"css-sizing-3","status":"local","text":"preferred aspect ratio","type":"dfn","url":"#preferred-aspect-ratio"}, "#preferred-size": {"displayText":"preferred size","export":true,"for_":[],"level":"3","normative":true,"shortname":"css-sizing","spec":"css-sizing-3","status":"local","text":"preferred size","type":"dfn","url":"#preferred-size"}, "#preferred-size-properties": {"displayText":"preferred size property","export":true,"for_":[],"level":"3","normative":true,"shortname":"css-sizing","spec":"css-sizing-3","status":"local","text":"preferred size property","type":"dfn","url":"#preferred-size-properties"}, "#propdef-box-sizing": {"displayText":"box-sizing","export":true,"for_":[],"level":"3","normative":true,"shortname":"css-sizing","spec":"css-sizing-3","status":"local","text":"box-sizing","type":"property","url":"#propdef-box-sizing"}, "#propdef-height": {"displayText":"height","export":true,"for_":[],"level":"3","normative":true,"shortname":"css-sizing","spec":"css-sizing-3","status":"local","text":"height","type":"property","url":"#propdef-height"}, "#propdef-max-height": {"displayText":"max-height","export":true,"for_":[],"level":"3","normative":true,"shortname":"css-sizing","spec":"css-sizing-3","status":"local","text":"max-height","type":"property","url":"#propdef-max-height"}, "#propdef-max-width": {"displayText":"max-width","export":true,"for_":[],"level":"3","normative":true,"shortname":"css-sizing","spec":"css-sizing-3","status":"local","text":"max-width","type":"property","url":"#propdef-max-width"}, "#propdef-min-height": {"displayText":"min-height","export":true,"for_":[],"level":"3","normative":true,"shortname":"css-sizing","spec":"css-sizing-3","status":"local","text":"min-height","type":"property","url":"#propdef-min-height"}, "#propdef-min-width": {"displayText":"min-width","export":true,"for_":[],"level":"3","normative":true,"shortname":"css-sizing","spec":"css-sizing-3","status":"local","text":"min-width","type":"property","url":"#propdef-min-width"}, "#propdef-width": {"displayText":"width","export":true,"for_":[],"level":"3","normative":true,"shortname":"css-sizing","spec":"css-sizing-3","status":"local","text":"width","type":"property","url":"#propdef-width"}, "#size": {"displayText":"size","export":true,"for_":[],"level":"3","normative":true,"shortname":"css-sizing","spec":"css-sizing-3","status":"local","text":"size","type":"dfn","url":"#size"}, "#sizing-property": {"displayText":"sizing property","export":true,"for_":[],"level":"3","normative":true,"shortname":"css-sizing","spec":"css-sizing-3","status":"local","text":"sizing property","type":"dfn","url":"#sizing-property"}, "#stretch-fit": {"displayText":"stretch fit","export":true,"for_":[],"level":"3","normative":true,"shortname":"css-sizing","spec":"css-sizing-3","status":"local","text":"stretch fit","type":"dfn","url":"#stretch-fit"}, "#stretch-fit-size": {"displayText":"stretch-fit size","export":true,"for_":[],"level":"3","normative":true,"shortname":"css-sizing","spec":"css-sizing-3","status":"local","text":"stretch-fit size","type":"dfn","url":"#stretch-fit-size"}, "#valdef-box-sizing-border-box": {"displayText":"border-box","export":true,"for_":["box-sizing"],"level":"3","normative":true,"shortname":"css-sizing","spec":"css-sizing-3","status":"local","text":"border-box","type":"value","url":"#valdef-box-sizing-border-box"}, "#valdef-column-width-fit-content-length-percentage": {"displayText":"fit-content(<length-percentage>)","export":true,"for_":["column-width"],"level":"3","normative":true,"shortname":"css-sizing","spec":"css-sizing-3","status":"local","text":"fit-content(<length-percentage>)","type":"value","url":"#valdef-column-width-fit-content-length-percentage"}, "#valdef-column-width-max-content": {"displayText":"max-content","export":true,"for_":["column-width"],"level":"3","normative":true,"shortname":"css-sizing","spec":"css-sizing-3","status":"local","text":"max-content","type":"value","url":"#valdef-column-width-max-content"}, "#valdef-column-width-min-content": {"displayText":"min-content","export":true,"for_":["column-width"],"level":"3","normative":true,"shortname":"css-sizing","spec":"css-sizing-3","status":"local","text":"min-content","type":"value","url":"#valdef-column-width-min-content"}, "#valdef-max-width-none": {"displayText":"none","export":true,"for_":["max-height","max-width"],"level":"3","normative":true,"shortname":"css-sizing","spec":"css-sizing-3","status":"local","text":"none","type":"value","url":"#valdef-max-width-none"}, "#valdef-width-auto": {"displayText":"auto","export":true,"for_":["height","min-height","min-width","width"],"level":"3","normative":true,"shortname":"css-sizing","spec":"css-sizing-3","status":"local","text":"auto","type":"value","url":"#valdef-width-auto"}, "#valdef-width-max-content": {"displayText":"max-content","export":true,"for_":["height","max-height","max-width","min-height","min-width","width"],"level":"3","normative":true,"shortname":"css-sizing","spec":"css-sizing-3","status":"local","text":"max-content","type":"value","url":"#valdef-width-max-content"}, "#valdef-width-min-content": {"displayText":"min-content","export":true,"for_":["height","max-height","max-width","min-height","min-width","width"],"level":"3","normative":true,"shortname":"css-sizing","spec":"css-sizing-3","status":"local","text":"min-content","type":"value","url":"#valdef-width-min-content"}, "#width": {"displayText":"width","export":true,"for_":[],"level":"3","normative":true,"shortname":"css-sizing","spec":"css-sizing-3","status":"local","text":"width","type":"dfn","url":"#width"}, "https://drafts.csswg.org/css-align-3/#gutter": {"displayText":"gutter","export":true,"for_":[],"level":"3","normative":true,"shortname":"css-align","spec":"css-align-3","status":"current","text":"gutter","type":"dfn","url":"https://drafts.csswg.org/css-align-3/#gutter"}, "https://drafts.csswg.org/css-backgrounds-3/#propdef-border": {"displayText":"border","export":true,"for_":[],"level":"3","normative":true,"shortname":"css-backgrounds","spec":"css-backgrounds-3","status":"current","text":"border","type":"property","url":"https://drafts.csswg.org/css-backgrounds-3/#propdef-border"}, "https://drafts.csswg.org/css-box-4/#border-box": {"displayText":"border box","export":true,"for_":[],"level":"4","normative":true,"shortname":"css-box","spec":"css-box-4","status":"current","text":"border box","type":"dfn","url":"https://drafts.csswg.org/css-box-4/#border-box"}, "https://drafts.csswg.org/css-box-4/#content-box": {"displayText":"content box","export":true,"for_":[],"level":"4","normative":true,"shortname":"css-box","spec":"css-box-4","status":"current","text":"content box","type":"dfn","url":"https://drafts.csswg.org/css-box-4/#content-box"}, "https://drafts.csswg.org/css-box-4/#margin": {"displayText":"margin","export":true,"for_":[],"level":"4","normative":true,"shortname":"css-box","spec":"css-box-4","status":"current","text":"margin","type":"dfn","url":"https://drafts.csswg.org/css-box-4/#margin"}, "https://drafts.csswg.org/css-box-4/#margin-properties": {"displayText":"margin properties","export":true,"for_":[],"level":"4","normative":true,"shortname":"css-box","spec":"css-box-4","status":"current","text":"margin properties","type":"dfn","url":"https://drafts.csswg.org/css-box-4/#margin-properties"}, "https://drafts.csswg.org/css-box-4/#padding": {"displayText":"padding","export":true,"for_":[],"level":"4","normative":true,"shortname":"css-box","spec":"css-box-4","status":"current","text":"padding","type":"dfn","url":"https://drafts.csswg.org/css-box-4/#padding"}, "https://drafts.csswg.org/css-box-4/#padding-properties": {"displayText":"padding properties","export":true,"for_":[],"level":"4","normative":true,"shortname":"css-box","spec":"css-box-4","status":"current","text":"padding properties","type":"dfn","url":"https://drafts.csswg.org/css-box-4/#padding-properties"}, "https://drafts.csswg.org/css-box-4/#propdef-padding": {"displayText":"padding","export":true,"for_":[],"level":"4","normative":true,"shortname":"css-box","spec":"css-box-4","status":"current","text":"padding","type":"property","url":"https://drafts.csswg.org/css-box-4/#propdef-padding"}, "https://drafts.csswg.org/css-cascade-5/#computed-value": {"displayText":"computed value","export":true,"for_":[],"level":"5","normative":true,"shortname":"css-cascade","spec":"css-cascade-5","status":"current","text":"computed value","type":"dfn","url":"https://drafts.csswg.org/css-cascade-5/#computed-value"}, "https://drafts.csswg.org/css-cascade-5/#initial-value": {"displayText":"initial value","export":true,"for_":[],"level":"5","normative":true,"shortname":"css-cascade","spec":"css-cascade-5","status":"current","text":"initial value","type":"dfn","url":"https://drafts.csswg.org/css-cascade-5/#initial-value"}, "https://drafts.csswg.org/css-contain-2/#size-containment": {"displayText":"size containment","export":true,"for_":[],"level":"2","normative":true,"shortname":"css-contain","spec":"css-contain-2","status":"current","text":"size containment","type":"dfn","url":"https://drafts.csswg.org/css-contain-2/#size-containment"}, "https://drafts.csswg.org/css-display-3/#box": {"displayText":"box","export":true,"for_":["CSS"],"level":"3","normative":true,"shortname":"css-display","spec":"css-display-3","status":"current","text":"box","type":"dfn","url":"https://drafts.csswg.org/css-display-3/#box"}, "https://drafts.csswg.org/css-display-3/#propdef-display": {"displayText":"display","export":true,"for_":[],"level":"3","normative":true,"shortname":"css-display","spec":"css-display-3","status":"current","text":"display","type":"property","url":"https://drafts.csswg.org/css-display-3/#propdef-display"}, "https://drafts.csswg.org/css-display-4/#block-box": {"displayText":"block box","export":true,"for_":[],"level":"4","normative":true,"shortname":"css-display","spec":"css-display-4","status":"current","text":"block box","type":"dfn","url":"https://drafts.csswg.org/css-display-4/#block-box"}, "https://drafts.csswg.org/css-display-4/#block-container": {"displayText":"block container","export":true,"for_":[],"level":"4","normative":true,"shortname":"css-display","spec":"css-display-4","status":"current","text":"block container","type":"dfn","url":"https://drafts.csswg.org/css-display-4/#block-container"}, "https://drafts.csswg.org/css-display-4/#containing-block": {"displayText":"containing block","export":true,"for_":[],"level":"4","normative":true,"shortname":"css-display","spec":"css-display-4","status":"current","text":"containing block","type":"dfn","url":"https://drafts.csswg.org/css-display-4/#containing-block"}, "https://drafts.csswg.org/css-display-4/#css-text-sequence": {"displayText":"text sequence","export":true,"for_":["CSS"],"level":"4","normative":true,"shortname":"css-display","spec":"css-display-4","status":"current","text":"text sequence","type":"dfn","url":"https://drafts.csswg.org/css-display-4/#css-text-sequence"}, "https://drafts.csswg.org/css-display-4/#display-type": {"displayText":"display type","export":true,"for_":[],"level":"4","normative":true,"shortname":"css-display","spec":"css-display-4","status":"current","text":"display type","type":"dfn","url":"https://drafts.csswg.org/css-display-4/#display-type"}, "https://drafts.csswg.org/css-display-4/#formatting-context": {"displayText":"formatting context","export":true,"for_":[],"level":"4","normative":true,"shortname":"css-display","spec":"css-display-4","status":"current","text":"formatting context","type":"dfn","url":"https://drafts.csswg.org/css-display-4/#formatting-context"}, "https://drafts.csswg.org/css-display-4/#initial-containing-block": {"displayText":"initial containing block","export":true,"for_":[],"level":"4","normative":true,"shortname":"css-display","spec":"css-display-4","status":"current","text":"initial containing block","type":"dfn","url":"https://drafts.csswg.org/css-display-4/#initial-containing-block"}, "https://drafts.csswg.org/css-display-4/#inline": {"displayText":"inline","export":true,"for_":[],"level":"4","normative":true,"shortname":"css-display","spec":"css-display-4","status":"current","text":"inline","type":"dfn","url":"https://drafts.csswg.org/css-display-4/#inline"}, "https://drafts.csswg.org/css-display-4/#inline-box": {"displayText":"inline box","export":true,"for_":[],"level":"4","normative":true,"shortname":"css-display","spec":"css-display-4","status":"current","text":"inline box","type":"dfn","url":"https://drafts.csswg.org/css-display-4/#inline-box"}, "https://drafts.csswg.org/css-display-4/#non-replaced": {"displayText":"non-replaced","export":true,"for_":[],"level":"4","normative":true,"shortname":"css-display","spec":"css-display-4","status":"current","text":"non-replaced","type":"dfn","url":"https://drafts.csswg.org/css-display-4/#non-replaced"}, "https://drafts.csswg.org/css-display-4/#replaced-element": {"displayText":"replaced element","export":true,"for_":[],"level":"4","normative":true,"shortname":"css-display","spec":"css-display-4","status":"current","text":"replaced element","type":"dfn","url":"https://drafts.csswg.org/css-display-4/#replaced-element"}, "https://drafts.csswg.org/css-flexbox-1/#flex-item": {"displayText":"flex item","export":true,"for_":[],"level":"1","normative":true,"shortname":"css-flexbox","spec":"css-flexbox-1","status":"current","text":"flex item","type":"dfn","url":"https://drafts.csswg.org/css-flexbox-1/#flex-item"}, "https://drafts.csswg.org/css-flexbox-1/#flex-layout": {"displayText":"flex layout","export":true,"for_":[],"level":"1","normative":true,"shortname":"css-flexbox","spec":"css-flexbox-1","status":"current","text":"flex layout","type":"dfn","url":"https://drafts.csswg.org/css-flexbox-1/#flex-layout"}, "https://drafts.csswg.org/css-flexbox-1/#propdef-flex-basis": {"displayText":"flex-basis","export":true,"for_":[],"level":"1","normative":true,"shortname":"css-flexbox","spec":"css-flexbox-1","status":"current","text":"flex-basis","type":"property","url":"https://drafts.csswg.org/css-flexbox-1/#propdef-flex-basis"}, "https://drafts.csswg.org/css-grid-2/#grid-item": {"displayText":"grid item","export":true,"for_":[],"level":"2","normative":true,"shortname":"css-grid","spec":"css-grid-2","status":"current","text":"grid item","type":"dfn","url":"https://drafts.csswg.org/css-grid-2/#grid-item"}, "https://drafts.csswg.org/css-images-3/#natural-aspect-ratio": {"displayText":"natural aspect ratio","export":true,"for_":[],"level":"3","normative":true,"shortname":"css-images","spec":"css-images-3","status":"current","text":"natural aspect ratio","type":"dfn","url":"https://drafts.csswg.org/css-images-3/#natural-aspect-ratio"}, "https://drafts.csswg.org/css-images-3/#natural-dimensions": {"displayText":"natural dimension","export":true,"for_":[],"level":"3","normative":true,"shortname":"css-images","spec":"css-images-3","status":"current","text":"natural dimension","type":"dfn","url":"https://drafts.csswg.org/css-images-3/#natural-dimensions"}, "https://drafts.csswg.org/css-images-3/#natural-size": {"displayText":"natural size","export":true,"for_":[],"level":"3","normative":true,"shortname":"css-images","spec":"css-images-3","status":"current","text":"natural size","type":"dfn","url":"https://drafts.csswg.org/css-images-3/#natural-size"}, "https://drafts.csswg.org/css-logical-1/#propdef-block-size": {"displayText":"block-size","export":true,"for_":[],"level":"1","normative":true,"shortname":"css-logical","spec":"css-logical-1","status":"current","text":"block-size","type":"property","url":"https://drafts.csswg.org/css-logical-1/#propdef-block-size"}, "https://drafts.csswg.org/css-logical-1/#propdef-max-block-size": {"displayText":"max-block-size","export":true,"for_":[],"level":"1","normative":true,"shortname":"css-logical","spec":"css-logical-1","status":"current","text":"max-block-size","type":"property","url":"https://drafts.csswg.org/css-logical-1/#propdef-max-block-size"}, "https://drafts.csswg.org/css-multicol-2/#propdef-column-width": {"displayText":"column-width","export":true,"for_":[],"level":"2","normative":true,"shortname":"css-multicol","spec":"css-multicol-2","status":"current","text":"column-width","type":"property","url":"https://drafts.csswg.org/css-multicol-2/#propdef-column-width"}, "https://drafts.csswg.org/css-page-3/#at-ruledef-page": {"displayText":"@page","export":true,"for_":[],"level":"3","normative":true,"shortname":"css-page","spec":"css-page-3","status":"current","text":"@page","type":"at-rule","url":"https://drafts.csswg.org/css-page-3/#at-ruledef-page"}, "https://drafts.csswg.org/css-sizing-4/#propdef-contain-intrinsic-size": {"displayText":"contain-intrinsic-size","export":true,"for_":[],"level":"4","normative":true,"shortname":"css-sizing","spec":"css-sizing-4","status":"current","text":"contain-intrinsic-size","type":"property","url":"https://drafts.csswg.org/css-sizing-4/#propdef-contain-intrinsic-size"}, "https://drafts.csswg.org/css-sizing-4/#valdef-contain-intrinsic-width-auto": {"displayText":"auto","export":true,"for_":["contain-intrinsic-width","contain-intrinsic-height","contain-intrinsic-block-size","contain-intrinsic-inline-size","contain-intrinsic-size"],"level":"4","normative":true,"shortname":"css-sizing","spec":"css-sizing-4","status":"current","text":"auto","type":"value","url":"https://drafts.csswg.org/css-sizing-4/#valdef-contain-intrinsic-width-auto"}, "https://drafts.csswg.org/css-sizing-4/#valdef-width-contain": {"displayText":"contain","export":true,"for_":["width","height","inline-size","block-size","min-width","min-height","min-inline-size","min-block-size","max-width","max-height","max-inline-size","max-block-size"],"level":"4","normative":true,"shortname":"css-sizing","spec":"css-sizing-4","status":"current","text":"contain","type":"value","url":"https://drafts.csswg.org/css-sizing-4/#valdef-width-contain"}, "https://drafts.csswg.org/css-sizing-4/#valdef-width-fit-content": {"displayText":"fit-content","export":true,"for_":["width","height","inline-size","block-size","min-width","min-height","min-inline-size","min-block-size","max-width","max-height","max-inline-size","max-block-size"],"level":"4","normative":true,"shortname":"css-sizing","spec":"css-sizing-4","status":"current","text":"fit-content","type":"value","url":"https://drafts.csswg.org/css-sizing-4/#valdef-width-fit-content"}, "https://drafts.csswg.org/css-sizing-4/#valdef-width-stretch": {"displayText":"stretch","export":true,"for_":["width","height","inline-size","block-size","min-width","min-height","min-inline-size","min-block-size","max-width","max-height","max-inline-size","max-block-size"],"level":"4","normative":true,"shortname":"css-sizing","spec":"css-sizing-4","status":"current","text":"stretch","type":"value","url":"https://drafts.csswg.org/css-sizing-4/#valdef-width-stretch"}, "https://drafts.csswg.org/css-text-4/#soft-wrap-opportunity": {"displayText":"soft wrap opportunity","export":true,"for_":[],"level":"4","normative":true,"shortname":"css-text","spec":"css-text-4","status":"current","text":"soft wrap opportunity","type":"dfn","url":"https://drafts.csswg.org/css-text-4/#soft-wrap-opportunity"}, "https://drafts.csswg.org/css-values-4/#comb-one": {"displayText":"|","export":true,"for_":[],"level":"4","normative":true,"shortname":"css-values","spec":"css-values-4","status":"current","text":"|","type":"grammar","url":"https://drafts.csswg.org/css-values-4/#comb-one"}, "https://drafts.csswg.org/css-values-4/#css-contain-a-percentage": {"displayText":"contain a percentage","export":true,"for_":["CSS"],"level":"4","normative":true,"shortname":"css-values","spec":"css-values-4","status":"current","text":"contain a percentage","type":"dfn","url":"https://drafts.csswg.org/css-values-4/#css-contain-a-percentage"}, "https://drafts.csswg.org/css-values-4/#css-wide-keywords": {"displayText":"CSS-wide keywords","export":true,"for_":[],"level":"4","normative":true,"shortname":"css-values","spec":"css-values-4","status":"current","text":"css-wide keywords","type":"dfn","url":"https://drafts.csswg.org/css-values-4/#css-wide-keywords"}, "https://drafts.csswg.org/css-values-4/#length-value": {"displayText":"<length>","export":true,"for_":[],"level":"4","normative":true,"shortname":"css-values","spec":"css-values-4","status":"current","text":"<length>","type":"type","url":"https://drafts.csswg.org/css-values-4/#length-value"}, "https://drafts.csswg.org/css-values-4/#percentage-value": {"displayText":"<percentage>","export":true,"for_":[],"level":"4","normative":true,"shortname":"css-values","spec":"css-values-4","status":"current","text":"<percentage>","type":"type","url":"https://drafts.csswg.org/css-values-4/#percentage-value"}, "https://drafts.csswg.org/css-values-4/#typedef-length-percentage": {"displayText":"<length-percentage>","export":true,"for_":[],"level":"4","normative":true,"shortname":"css-values","spec":"css-values-4","status":"current","text":"<length-percentage>","type":"type","url":"https://drafts.csswg.org/css-values-4/#typedef-length-percentage"}, "https://drafts.csswg.org/css-writing-modes-4/#block-axis": {"displayText":"block axis","export":true,"for_":[],"level":"4","normative":true,"shortname":"css-writing-modes","spec":"css-writing-modes-4","status":"current","text":"block axis","type":"dfn","url":"https://drafts.csswg.org/css-writing-modes-4/#block-axis"}, "https://drafts.csswg.org/css-writing-modes-4/#block-size": {"displayText":"block size","export":true,"for_":[],"level":"4","normative":true,"shortname":"css-writing-modes","spec":"css-writing-modes-4","status":"current","text":"block size","type":"dfn","url":"https://drafts.csswg.org/css-writing-modes-4/#block-size"}, "https://drafts.csswg.org/css-writing-modes-4/#flow-relative": {"displayText":"flow-relative","export":true,"for_":[],"level":"4","normative":true,"shortname":"css-writing-modes","spec":"css-writing-modes-4","status":"current","text":"flow-relative","type":"dfn","url":"https://drafts.csswg.org/css-writing-modes-4/#flow-relative"}, "https://drafts.csswg.org/css-writing-modes-4/#inline-axis": {"displayText":"inline axis","export":true,"for_":[],"level":"4","normative":true,"shortname":"css-writing-modes","spec":"css-writing-modes-4","status":"current","text":"inline axis","type":"dfn","url":"https://drafts.csswg.org/css-writing-modes-4/#inline-axis"}, "https://drafts.csswg.org/css-writing-modes-4/#inline-size": {"displayText":"inline size","export":true,"for_":[],"level":"4","normative":true,"shortname":"css-writing-modes","spec":"css-writing-modes-4","status":"current","text":"inline size","type":"dfn","url":"https://drafts.csswg.org/css-writing-modes-4/#inline-size"}, "https://drafts.csswg.org/css-writing-modes-4/#physical": {"displayText":"physical","export":true,"for_":[],"level":"4","normative":true,"shortname":"css-writing-modes","spec":"css-writing-modes-4","status":"current","text":"physical","type":"dfn","url":"https://drafts.csswg.org/css-writing-modes-4/#physical"}, "https://drafts.csswg.org/css-writing-modes-4/#writing-mode": {"displayText":"writing mode","export":true,"for_":[],"level":"4","normative":true,"shortname":"css-writing-modes","spec":"css-writing-modes-4","status":"current","text":"writing mode","type":"dfn","url":"https://drafts.csswg.org/css-writing-modes-4/#writing-mode"}, "https://drafts.csswg.org/cssom-1/#dom-window-getcomputedstyle": {"displayText":"getComputedStyle(elt)","export":true,"for_":["Window"],"level":"1","normative":true,"shortname":"cssom","spec":"cssom-1","status":"current","text":"getComputedStyle(elt)","type":"method","url":"https://drafts.csswg.org/cssom-1/#dom-window-getcomputedstyle"}, "https://drafts.csswg.org/cssom-1/#resolved-value": {"displayText":"resolved value","export":true,"for_":[],"level":"1","normative":true,"shortname":"cssom","spec":"cssom-1","status":"current","text":"resolved value","type":"dfn","url":"https://drafts.csswg.org/cssom-1/#resolved-value"}, "https://html.spec.whatwg.org/multipage/form-elements.html#concept-textarea-raw-value": {"displayText":"raw value","export":false,"for_":[],"level":"1","normative":true,"shortname":"html","spec":"html","status":"current","text":"raw value","type":"dfn","url":"https://html.spec.whatwg.org/multipage/form-elements.html#concept-textarea-raw-value"}, "https://html.spec.whatwg.org/multipage/form-elements.html#the-button-element": {"displayText":"button","export":true,"for_":[],"level":"1","normative":true,"shortname":"html","spec":"html","status":"current","text":"button","type":"element","url":"https://html.spec.whatwg.org/multipage/form-elements.html#the-button-element"}, "https://html.spec.whatwg.org/multipage/form-elements.html#the-meter-element": {"displayText":"meter","export":true,"for_":[],"level":"1","normative":true,"shortname":"html","spec":"html","status":"current","text":"meter","type":"element","url":"https://html.spec.whatwg.org/multipage/form-elements.html#the-meter-element"}, "https://html.spec.whatwg.org/multipage/form-elements.html#the-progress-element": {"displayText":"progress","export":true,"for_":[],"level":"1","normative":true,"shortname":"html","spec":"html","status":"current","text":"progress","type":"element","url":"https://html.spec.whatwg.org/multipage/form-elements.html#the-progress-element"}, "https://html.spec.whatwg.org/multipage/form-elements.html#the-select-element": {"displayText":"select","export":true,"for_":[],"level":"1","normative":true,"shortname":"html","spec":"html","status":"current","text":"select","type":"element","url":"https://html.spec.whatwg.org/multipage/form-elements.html#the-select-element"}, "https://html.spec.whatwg.org/multipage/form-elements.html#the-textarea-element": {"displayText":"textarea","export":true,"for_":[],"level":"1","normative":true,"shortname":"html","spec":"html","status":"current","text":"textarea","type":"element","url":"https://html.spec.whatwg.org/multipage/form-elements.html#the-textarea-element"}, "https://html.spec.whatwg.org/multipage/iframe-embed-object.html#the-iframe-element": {"displayText":"iframe","export":true,"for_":[],"level":"1","normative":true,"shortname":"html","spec":"html","status":"current","text":"iframe","type":"element","url":"https://html.spec.whatwg.org/multipage/iframe-embed-object.html#the-iframe-element"}, "https://html.spec.whatwg.org/multipage/input.html#attr-input-type": {"displayText":"type","export":true,"for_":["input"],"level":"1","normative":true,"shortname":"html","spec":"html","status":"current","text":"type","type":"element-attr","url":"https://html.spec.whatwg.org/multipage/input.html#attr-input-type"}, "https://html.spec.whatwg.org/multipage/input.html#the-input-element": {"displayText":"input","export":true,"for_":[],"level":"1","normative":true,"shortname":"html","spec":"html","status":"current","text":"input","type":"element","url":"https://html.spec.whatwg.org/multipage/input.html#the-input-element"}, "https://html.spec.whatwg.org/multipage/obsolete.html#the-marquee-element": {"displayText":"marquee","export":true,"for_":[],"level":"1","normative":true,"shortname":"html","spec":"html","status":"current","text":"marquee","type":"element","url":"https://html.spec.whatwg.org/multipage/obsolete.html#the-marquee-element"}, }; function mkRefHint(link, ref) { const linkText = link.textContent; let dfnTextElements = ''; if (ref.displayText.toLowerCase() != linkText.toLowerCase()) { // Give the original term if it's being displayed in a different way. // But allow casing differences, they're insignificant. dfnTextElements = mk.li({}, mk.b({}, "Term: "), mk.span({}, ref.displayText) ); } const forList = ref.for_; let forListElements; if(forList.length == 0) { forListElements = []; } else if(forList.length == 1) { forListElements = mk.li({}, mk.b({}, "For: "), mk.span({}, forList[0]), ); } else { forListElements = mk.li({}, mk.b({}, "For: "), mk.ul({}, ...forList.map(forItem => mk.li({}, mk.span({}, forItem) ), ), ), ); } const url = ref.url; const safeUrl = encodeURIComponent(url); const hintPanel = mk.aside({ class: "ref-hint", id: `ref-hint-for-${safeUrl}`, "data-for": url, "aria-labelled-by": `ref-hint-for-${safeUrl}`, }, mk.ul({}, dfnTextElements, mk.li({}, mk.b({}, "URL: "), mk.a({ href: url, class: "ref" }, url), ), mk.li({}, mk.b({}, "Type: "), mk.span({}, `${ref.type}`), ), mk.li({}, mk.b({}, "Spec: "), mk.span({}, `${ref.spec ? ref.spec : ''}`), ), forListElements ), ); hintPanel.forLink = link; setupRefHintEventListeners(link, hintPanel); return hintPanel; } function hideAllRefHints() { queryAll(".ref-hint").forEach(el=>hideRefHint(el)); } function hideRefHint(refHint) { const link = refHint.forLink; link.setAttribute("aria-expanded", "false"); if(refHint.teardownEventListeners) { refHint.teardownEventListeners(); } refHint.remove(); } function showRefHint(link) { if(link.classList.contains("dfn-link")) return; const url = link.getAttribute("href"); const refHintKey = link.getAttribute("data-refhint-key"); let key = url; if(refHintKey) { key = refHintKey + "_" + url; } const ref = refsData[key]; if(!ref) return; hideAllRefHints(); // Only display one at this time. const refHint = mkRefHint(link, ref); append(document.body, refHint); link.setAttribute("aria-expanded", "true"); positionRefHint(refHint); } function setupRefHintEventListeners(link, refHint) { if (refHint.teardownEventListeners) return; // Add event handlers to hide the refHint after the user moves away // from both the link and refHint, if not hovering either within one second. let timeout = null; const startHidingRefHint = (event) => { if (timeout) { clearTimeout(timeout); } timeout = setTimeout(() => { hideRefHint(refHint); }, 1000); } const resetHidingRefHint = (event) => { if (timeout) clearTimeout(timeout); timeout = null; }; link.addEventListener("mouseleave", startHidingRefHint); link.addEventListener("mouseenter", resetHidingRefHint); link.addEventListener("blur", startHidingRefHint); link.addEventListener("focus", resetHidingRefHint); refHint.addEventListener("mouseleave", startHidingRefHint); refHint.addEventListener("mouseenter", resetHidingRefHint); refHint.addEventListener("blur", startHidingRefHint); refHint.addEventListener("focus", resetHidingRefHint); refHint.teardownEventListeners = () => { // remove event listeners resetHidingRefHint(); link.removeEventListener("mouseleave", startHidingRefHint); link.removeEventListener("mouseenter", resetHidingRefHint); link.removeEventListener("blur", startHidingRefHint); link.removeEventListener("focus", resetHidingRefHint); refHint.removeEventListener("mouseleave", startHidingRefHint); refHint.removeEventListener("mouseenter", resetHidingRefHint); refHint.removeEventListener("blur", startHidingRefHint); refHint.removeEventListener("focus", resetHidingRefHint); }; } function positionRefHint(refHint) { const link = refHint.forLink; const linkPos = getBounds(link); refHint.style.top = linkPos.bottom + "px"; refHint.style.left = linkPos.left + "px"; const panelPos = refHint.getBoundingClientRect(); const panelMargin = 8; const maxRight = document.body.parentNode.clientWidth - panelMargin; if (panelPos.right > maxRight) { const overflowAmount = panelPos.right - maxRight; const newLeft = Math.max(panelMargin, linkPos.left - overflowAmount); refHint.style.left = newLeft + "px"; } } // TODO: shared util // Returns the root-level absolute position {left and top} of element. function getBounds(el, relativeTo=document.body) { const relativeRect = relativeTo.getBoundingClientRect(); const elRect = el.getBoundingClientRect(); const top = elRect.top - relativeRect.top; const left = elRect.left - relativeRect.left; return { top, left, bottom: top + elRect.height, right: left + elRect.width, } } function showRefHintListener(e) { // If the target isn't in a link (or is a link), // just ignore it. let link = e.target.closest("a"); if(!link) return; // If the target is in a ref-hint panel // (aka a link in the already-open one), // also just ignore it. if(link.closest(".ref-hint")) return; // Otherwise, show the panel for the link. showRefHint(link); } function hideAllHintsListener(e) { // If the click is inside a ref-hint panel, ignore it. if(e.target.closest(".ref-hint")) return; // Otherwise, close all the current panels. hideAllRefHints(); } document.addEventListener("DOMContentLoaded", () => { document.body.addEventListener("mousedown", showRefHintListener); document.body.addEventListener("focus", showRefHintListener); document.body.addEventListener("click", hideAllHintsListener); }); window.addEventListener("resize", () => { // Hide any open ref hint. hideAllRefHints(); }); } </script>

Pages: 1 2 3 4 5 6 7 8 9 10