Results for “code”
Small, practical examples. Search by task or narrow things down below.
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 counter from wrapping at its maximum
Arduino / C: Increment only when the value is below its limit.
Arduino / C✓ Tested
Keep a decorative icon out of a button’s name
HTML: aria-hidden excludes a decorative character while leaving the visible action text as the accessible name.
HTML✓ Tested
Keep a dollar sign literal
PowerShell: Keep a dollar sign literal using PowerShell 7.
PowerShell✓ Tested
Keep a function variable local
Bash Scripts: Local prevents an ordinary function assignment from replacing a caller variable.
Bash Scripts✓ Tested
Keep a label available without occupying visible layout space
CSS: A clipped one-pixel label remains the input’s accessible name.
CSS✓ Tested
Keep a mutable value without rendering on each write
Keep a mutable value without rendering on each write with a small React component and explicit browser behavior.
React✓ Tested
Keep a secondary button from submitting a form
Keep a secondary button from submitting a form with a standalone Angular component and explicit browser behavior.
Angular✓ 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 serial message in flash memory
Arduino / C: The F macro keeps a literal out of scarce SRAM.
Arduino / C✓ 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
Keep a value inside an allowed range
Arduino / C: Keep a value inside an allowed range on an Uno with the Serial Monitor set to 9600 baud.
Arduino / C✓ Tested