Results for “Box dimensions & overflow”
Small, practical examples. Search by task or narrow things down below.
Align an image within its content box
CSS: Object-position places the rendered object when fitting leaves spare space or crops an edge.
CSS✓ Tested
Arrange children with flexbox
CSS: Learn how to arrange children with flexbox in a complete browser example.
CSS✓ Tested
Bind a checkbox with ngModel
Bind a checkbox with ngModel with a standalone Angular component and explicit browser behavior.
Angular✓ Tested
Calculate a page count without an overflowing addition
C: Divide first and add one only when a nonzero remainder remains.
C✓ Tested
Center content with flexbox
Center a child along both axes inside a CSS flex container.
CSS✓ Tested
Choose which overlapping box receives a pointer
CSS: Z-index controls the stack level of these positioned sibling elements.
CSS✓ Tested
Control a checkbox
Control a checkbox with a small React component and explicit browser behavior.
React✓ Tested
Detect integer addition overflow
Java: Math.addExact throws rather than silently wrapping on overflow.
Java✓ Tested
Detect integer overflow with checked
C#: A checked arithmetic block throws instead of silently wrapping an integer result.
C#✓ Tested
Fit an entire image inside a differently shaped box
CSS: Contain preserves the image aspect ratio while keeping all of it visible inside the specified content box.
CSS✓ Tested
Handle integer overflow without panicking
Handle integer overflow without panicking in a complete Rust program using the standard library.
Rust✓ Tested
Move a box visually without changing its layout slot
CSS: Transforms change the painted geometry while leaving surrounding normal-flow layout unchanged.
CSS✓ Tested