Results for “Box dimensions & overflow”
Small, practical examples. Search by task or narrow things down below.
Own a heap-allocated value with Box
Own a heap-allocated value with Box in a complete Rust program using the standard library.
Rust✓ Tested
Require a checkbox to be selected
HTML: A required checkbox is invalid until that individual control is checked.
HTML✓ Tested
Reserve an image’s display dimensions
HTML: Width and height attributes supply a known display size and aspect ratio before decoding finishes.
HTML✓ Tested
Rotate a rectangular box around its center
CSS: A ninety-degree transform swaps the visible bounding-box width and height.
CSS✓ Tested
Allow a long flex child to shrink inside its container
CSS: Min-width zero removes the default content-size floor so local overflow handling can take effect.
CSS✓ Tested
Measure content, padding, and borders separately
jQuery: width, innerWidth, and outerWidth measure different parts of the box.
jQuery✓ Tested
Prevent an item from shrinking
CSS: Flex-shrink zero preserves a required size even when the container overflows.
CSS✓ Tested
Align flex items at the main-axis end
CSS: Flex-end uses the trailing edge of the flex container for packing.
CSS✓ Tested
Allow long content to scroll
CSS: Learn how to allow long content to scroll in a complete browser example.
CSS✓ Tested
Block scripts in an embedded document
HTML: An empty sandbox attribute applies the default set of restrictions, including blocking script execution.
HTML✓ Tested
Change visual order without changing DOM order
CSS: Order changes flex painting positions while keyboard and reading order still follow the document.
CSS✓ Tested
Check an array allocation size before multiplying
C: Compare the requested element count against SIZE_MAX divided by element size.
C✓ Tested