Results for “html”
Small, practical examples. Search by task or narrow things down below.
Position a badge relative to its container
CSS: A positioned ancestor establishes the containing block for an absolutely positioned child.
CSS✓ Tested
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
Post a JSON request body
jQuery: JSON.stringify and application/json send a JSON document.
jQuery✓ Tested
Post URL-encoded form data
jQuery: post sends a data object as form-encoded fields by default.
jQuery✓ Tested
Preserve an aspect ratio
Reserve a 16:9 CSS box without a fixed height.
CSS✓ Tested
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
Preserve line breaks while collapsing repeated spaces
CSS: Pre-line retains newlines but does not preserve all whitespace like pre-wrap does.
CSS✓ Tested
Preserve whitespace while wrapping
Use CSS pre-wrap for multiline text that retains spaces.
CSS✓ Tested
Prevent a link’s default navigation
Prevent a link’s default navigation with a standalone Angular component and explicit browser behavior.
Angular✓ Tested
Prevent an item from shrinking
CSS: Flex-shrink zero preserves a required size even when the container overflows.
CSS✓ Tested
Prevent navigation from a handled link
jQuery: preventDefault cancels the browser action without cancelling event bubbling.
jQuery✓ Tested
Project content into a reusable component
Project content into a reusable component with a standalone Angular component and explicit browser behavior.
Angular✓ Tested