MDN The block-sizeCSS property defines the size of an element's block along the block axis. If the writing-mode is horizontal, it corresponds to the height; if the writing mode is vertical, it corresponds to the width. A related property is inline-size, which defines the other dimension of the element.
<section class="default-example" id="default-example"> <div class="transition-all" id="example-element"> This is a box where you can change the block-size. </div></section>
Syntax
auto | <box-size> | <anchor-size()>
Formal grammar from the specification, as webref extracts it: the latest level's definition, sometimes ahead of what browsers implement.
Definition
Initial
auto
Applies to
all elements except non-replaced inlines
Inherited
no
Percentages
relative to width/height of containing block
Computed value
as specified, with <length-percentage> values computed
Canonical order
per grammar
Animation type
by computed value type, recursing into fit-content()
Browser support
First browser version supporting block-size
Chrome
57
Edge
79
Firefox
41
Safari
12.1
Chrome Android
57
Safari iOS
12.2
First version with support, from MDN browser-compat-data.
<section id="default-example"> <p id="example-element"> London. Michaelmas term lately over, and the Lord Chancellor sitting in Lincoln's Inn Hall. Implacable November weather. As much mud in the streets as if the waters had but newly retired from the face of the earth, and it would not be wonderful to meet a Megalosaurus, forty feet long or so, waddling like an elephantine lizard up Holborn Hill. </p></section>
Syntax
auto | <box-size> | auto | <box-size>
Formal grammar from the specification, as webref extracts it: the latest level's definition, sometimes ahead of what browsers implement.
Definition
Computed value
as specified, with <length-percentage> values computed
Animation type
by computed value type
Browser support
First browser version supporting column-width
Chrome
50
Edge
12
Firefox
50
Safari
9
Chrome Android
50
Safari iOS
9
First version with support, from MDN browser-compat-data.
MDN The contain-intrinsic-block-sizeCSSlogical property defines the block size of an element that a browser can use for layout when the element is subject to size containment.
MDN The contain-intrinsic-heightCSS property sets the height of an element that a browser can use for layout when the element is subject to size containment.
MDN The contain-intrinsic-inline-sizeCSSlogical property defines the inline-size of an element that a browser can use for layout when the element is subject to size containment.
MDN The contain-intrinsic-sizeCSSshorthand property sets the size of an element that a browser will use for layout when the element is subject to size containment.
Live previewExample from MDN
div,p { padding: 1rem; margin-bottom: 1rem; font-size: 2rem; font-family: sans-serif;}code { background-color: lightgray; padding: 0.25rem; border-radius: 0.25rem;}#container { width: 90%; height: 80%;}.auto-length,.auto-length.none { display: none;}#auto-length-note,#auto-none-note { display: block; padding: 0;}#auto-length-note p,#auto-none-note p { padding: 0.5rem; width: 100%; height: max-content; font-size: 1rem; line-height: 1.5rem; background-color: tomato;}@supports (contain-intrinsic-size: auto none) { .auto-length.none { display: block; } #auto-none-note { display: none; }}@supports (contain-intrinsic-size: auto 500px) { .auto-length { display: block; } #auto-length-note { display: none; }}p { height: 500px; width: 500px; border: 4px dotted; background: lightblue;}.auto-length { content-visibility: auto; contain-intrinsic-size: auto 500px; background-color: linen; outline: 4px dotted blue;}.large-intrinsic-size { /* Setting an inaccurate intrinsic size for the element */ contain-intrinsic-size: auto 5000px; background-color: lightgray; outline: 4px dotted red;}.small { /* This element is a lot smaller than expected */ height: 100px; width: 100px;}.none { background-color: papayawhip; contain-intrinsic-size: auto none; outline: 4px dotted red;}
<div id="container"> <div id="auto-length-note"> <p> Your browser does not support <code>contain-intrinsic-size: auto <length></code>. </p> </div> <div class="auto-length"> <p>Item one</p> </div> <div class="auto-length"> <p>Item two</p> </div> <div class="auto-length large-intrinsic-size"> <p class="small">Item three</p> </div> <div class="auto-length large-intrinsic-size"> <p class="small">Item four</p> </div> <div id="auto-none-note"> <p> Your browser does not support <code>contain-intrinsic-size: auto none</code>. </p> </div> <div class="auto-length none"> <p>Item five</p> </div> <div class="auto-length none"> <p>Item six</p> </div></div>
Syntax
[ auto? [ none | <length [0,∞]> ] ]{1,2}
Formal grammar from the specification, as webref extracts it: the latest level's definition, sometimes ahead of what browsers implement.
MDN The contain-intrinsic-widthCSS property sets the width of an element that a browser will use for layout when the element is subject to size containment.
MDN The frame-sizingCSS property can be used to set an <iframe> element's horizontal or vertical size to equal the layout size of its embedded document in the same dimension, but only if the embedded document has opted in to sharing its size information.
<h1>Responsive iframes — basic example</h1><iframe src="frame.html"></iframe><head> ... <meta name="responsive-embedded-sizing" /> ...</head><body> <h1>This is my frame</h1> <p>This is the content of my discontent.</p> <p>This is some more content.</p></body>
Syntax
auto | content-width | content-height | content-block-size | content-inline-size
Formal grammar from the specification, as webref extracts it: the latest level's definition, sometimes ahead of what browsers implement.
Definition
Initial
auto
Applies to
replaced elements (but see below for details)
Inherited
no
Percentages
n/a
Computed value
as specified
Canonical order
per grammar
Animation type
discrete
Browser support
First browser version supporting frame-sizing
Chrome
154
Edge
154
Firefox
No
Safari
No
Chrome Android
154
Safari iOS
No
First version with support, from MDN browser-compat-data.
MDN The inline-sizeCSS property defines the size of an element's block along the inline axis. If the writing-mode is horizontal, it corresponds to the width; if the writing mode is vertical, it corresponds to the height. A related property is block-size, which defines the other dimension of the element.
<section class="default-example" id="default-example"> <div class="transition-all" id="example-element"> This is a box where you can change the inline-size. </div></section>
Syntax
auto | <box-size> | <anchor-size()>
Formal grammar from the specification, as webref extracts it: the latest level's definition, sometimes ahead of what browsers implement.
Definition
Initial
auto
Applies to
all elements except non-replaced inlines
Inherited
no
Percentages
relative to width/height of containing block
Computed value
as specified, with <length-percentage> values computed
Canonical order
per grammar
Animation type
by computed value type, recursing into fit-content()
Browser support
First browser version supporting inline-size
Chrome
57
Edge
79
Firefox
41
Safari
12.1
Chrome Android
57
Safari iOS
12.2
First version with support, from MDN browser-compat-data.
MDN The max-block-sizeCSS property specifies the maximum size of an element in the direction opposite that of the writing direction as specified by writing-mode. That is, if the writing direction is horizontal, then max-block-size is equivalent to max-height; if the writing direction is vertical, max-block-size is the same as max-width.
<section class="default-example" id="default-example"> <div class="transition-all" id="example-element"> This is a box where you can change the maximum block size. <br />This will limit the size in the block dimension, potentially causing an overflow. </div></section>
Syntax
none | <box-size> | <anchor-size()>
Formal grammar from the specification, as webref extracts it: the latest level's definition, sometimes ahead of what browsers implement.
Definition
Initial
none
Applies to
all elements that accept width or height
Inherited
no
Percentages
relative to width/height of containing block
Computed value
as specified, with <length-percentage> values computed
Canonical order
per grammar
Animation type
by computed value, recursing into fit-content()
Browser support
First browser version supporting max-block-size
Chrome
57
Edge
79
Firefox
41
Safari
12.1
Chrome Android
57
Safari iOS
12.2
First version with support, from MDN browser-compat-data.
MDN The max-heightCSS property sets the maximum height of an element. It prevents the used value of the height property from becoming larger than the value specified for max-height.
<section class="default-example" id="default-example"> <div class="transition-all" id="example-element"> This is a box where you can change the maximum height. <br />This will limit how tall the box can be, potentially causing an overflow. </div></section>
Syntax
none | <box-size> | <anchor-size()>
Formal grammar from the specification, as webref extracts it: the latest level's definition, sometimes ahead of what browsers implement.
Definition
Initial
none
Applies to
all elements that accept width or height
Inherited
no
Percentages
relative to width/height of containing block
Computed value
as specified, with <length-percentage> values computed
Canonical order
per grammar
Animation type
by computed value, recursing into fit-content()
Browser support
First browser version supporting max-height
Chrome
1
Edge
12
Firefox
1
Safari
1.3
Chrome Android
18
Safari iOS
1
First version with support, from MDN browser-compat-data.
MDN The max-inline-sizeCSS property defines the horizontal or vertical maximum size of an element's block, depending on its writing mode. It corresponds to either the max-width or the max-height property, depending on the value of writing-mode.
<section class="default-example" id="default-example"> <div class="transition-all" id="example-element"> This is a box where you can change the max-inline-size. </div></section>
Syntax
none | <box-size> | <anchor-size()>
Formal grammar from the specification, as webref extracts it: the latest level's definition, sometimes ahead of what browsers implement.
Definition
Initial
none
Applies to
all elements that accept width or height
Inherited
no
Percentages
relative to width/height of containing block
Computed value
as specified, with <length-percentage> values computed
Canonical order
per grammar
Animation type
by computed value, recursing into fit-content()
Browser support
First browser version supporting max-inline-size
Chrome
57
Edge
79
Firefox
41
Safari
12.1
Chrome Android
57
Safari iOS
12.2
First version with support, from MDN browser-compat-data.
MDN The max-widthCSS property sets the maximum width of an element. It prevents the used value of the width property from becoming larger than the value specified by max-width.
MDN The min-block-sizeCSS property defines the minimum horizontal or vertical size of an element's block, depending on its writing mode. It corresponds to either the min-width or the min-height property, depending on the value of writing-mode.
<section class="default-example" id="default-example"> <div class="transition-all" id="example-element"> This is a box where you can change the minimum block size. <br />If there is more content than the minimum the box will grow in the block dimension as needed by the content. </div></section>
Syntax
auto | <box-size> | <anchor-size()>
Formal grammar from the specification, as webref extracts it: the latest level's definition, sometimes ahead of what browsers implement.
Definition
Initial
auto
Applies to
all elements that accept width or height
Inherited
no
Percentages
relative to width/height of containing block
Computed value
as specified, with <length-percentage> values computed
Canonical order
per grammar
Animation type
by computed value, recursing into fit-content()
Browser support
First browser version supporting min-block-size
Chrome
57
Edge
79
Firefox
41
Safari
12.1
Chrome Android
57
Safari iOS
12.2
First version with support, from MDN browser-compat-data.
MDN The min-heightCSS 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.
<section class="default-example" id="default-example"> <div class="transition-all" id="example-element"> This is a box where you can change the minimum height. <br />If there is more content than the minimum the box will grow to the height needed by the content. </div></section>
Syntax
auto | <box-size> | <anchor-size()>
Formal grammar from the specification, as webref extracts it: the latest level's definition, sometimes ahead of what browsers implement.
Definition
Initial
auto
Applies to
all elements that accept width or height
Inherited
no
Percentages
relative to width/height of containing block
Computed value
as specified, with <length-percentage> values computed
Canonical order
per grammar
Animation type
by computed value, recursing into fit-content()
Browser support
First browser version supporting min-height
Chrome
1
Edge
12
Firefox
3
Safari
1.3
Chrome Android
18
Safari iOS
1
First version with support, from MDN browser-compat-data.
MDN The min-inline-sizeCSS property defines the horizontal or vertical minimal size of an element's block, depending on its writing mode. It corresponds to either the min-width or the min-height property, depending on the value of writing-mode.
MDN The min-widthCSS 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.
MDN The sizeCSSat-rule descriptor, used with the @page at-rule, defines the size and orientation of the box which is used to represent a page. Most of the time, this size corresponds to the target size of the printed page if applicable.
Syntax
<'width'> <'height'>?
Formal grammar from the specification, as webref extracts it: the latest level's definition, sometimes ahead of what browsers implement.