FIND YOUR NEXT FEW LINES

Results for “html”

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

503 snippets foundClear filters
CSSPositioning & stacking

Position a badge relative to its container

CSS: A positioned ancestor establishes the containing block for an absolutely positioned child.

CSS✓ Tested
CSSPositioning & stacking

Position an item from the writing direction’s start edge

CSS: Logical insets follow direction, so inline-start is the right side in this RTL container.

CSS✓ Tested
jQueryHTTP requests

Post a JSON request body

jQuery: JSON.stringify and application/json send a JSON document.

jQuery✓ Tested
jQueryHTTP requests

Post URL-encoded form data

jQuery: post sends a data object as form-encoded fields by default.

jQuery✓ Tested
CSSResponsive design

Preserve an aspect ratio

Reserve a 16:9 CSS box without a fixed height.

CSS✓ Tested
AngularAccessibility & reusable patterns

Preserve input state when tracked records reorder

Preserve input state when tracked records reorder with a standalone Angular component and explicit browser behavior.

Angular✓ Tested
CSSType & reading flow

Preserve line breaks while collapsing repeated spaces

CSS: Pre-line retains newlines but does not preserve all whitespace like pre-wrap does.

CSS✓ Tested
CSSTypography

Preserve whitespace while wrapping

Use CSS pre-wrap for multiline text that retains spaces.

CSS✓ Tested
AngularEvents & DOM interaction

Prevent a link’s default navigation

Prevent a link’s default navigation with a standalone Angular component and explicit browser behavior.

Angular✓ Tested
CSSFlexbox alignment

Prevent an item from shrinking

CSS: Flex-shrink zero preserves a required size even when the container overflows.

CSS✓ Tested
jQueryEvent control

Prevent navigation from a handled link

jQuery: preventDefault cancels the browser action without cancelling event bubbling.

jQuery✓ Tested
AngularGetting Started

Project content into a reusable component

Project content into a reusable component with a standalone Angular component and explicit browser behavior.

Angular✓ Tested