Results for “stack”
Small, practical examples. Search by task or narrow things down below.
Keep a child’s large z-index inside a stacking context
CSS: Isolation creates a stacking context so an internal stack level cannot outrank an outside sibling’s higher context.
CSS✓ Tested
Stack columns on small screens
Change a two-column CSS grid to one column at a viewport breakpoint.
CSS✓ Tested
Stack flex items vertically
CSS: Flex-direction column makes the main axis vertical.
CSS✓ Tested
Use a deque as a stack
Java: Use push and pop for last-in, first-out behavior.
Java✓ Tested
Use a last-in first-out stack
C#: Stack is useful for reversible traversal and other nested operations.
C#✓ Tested
Use a last-in first-out stack
C++: Read top before pop because pop does not return the removed value.
C++✓ Tested
Center a fixed-size absolute child with auto margins
CSS: An all-zero inset plus auto margins distributes the available space around the child.
CSS✓ Tested
Choose which overlapping box receives a pointer
CSS: Z-index controls the stack level of these positioned sibling elements.
CSS✓ Tested
Keep a control fixed to the viewport during scrolling
CSS: Fixed positioning normally uses the viewport when no ancestor establishes a different fixed containing block.
CSS✓ Tested
Keep a section heading at a scrolling panel’s top
CSS: Sticky positioning sticks within its scroll container after reaching the specified inset.
CSS✓ Tested
Keep a tall section inside a local vertical scroller
CSS: A bounded height and overflow auto keep long content from stretching the surrounding page.
CSS✓ 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