FIND YOUR NEXT FEW LINES

Results for “if”

Small, practical examples. Search by task or narrow things down below.

946 snippets foundClear filters
CSSPositioning & stacking

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
CSSPositioning & stacking

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
HTMLAccessible structure

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
CSSVisual treatment & accessibility

Keep a label available without occupying visible layout space

CSS: A clipped one-pixel label remains the input’s accessible name.

CSS✓ Tested
CSSPositioning & stacking

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
CSSPositioning & stacking

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
CSSResponsive conditions & sizing

Keep a viewport-relative size above a minimum

CSS: Max selects the larger of the candidate lengths.

CSS✓ Tested
HTMLForm behavior

Keep an action button from submitting a form

HTML: Specify type button for controls whose purpose is a local action.

HTML✓ Tested
HTMLImages & embedded documents

Keep an image and its visible caption together

HTML: Figure and figcaption represent a self-contained illustration with an associated caption.

HTML✓ Tested
JavaScriptArray restructuring

Keep both matching and rejected values

JavaScript: Use two explicit outputs when a caller needs both sides of a classification.

JavaScript✓ Tested
TypeScriptArray restructuring

Keep both matching and rejected values

TypeScript: Use two explicit outputs when a caller needs both sides of a classification.

TypeScript✓ Tested
SQLConstraints & defaults

Keep children while clearing a deleted relationship

SQL: ON DELETE SET NULL requires a nullable foreign-key column.

SQL✓ Tested