Results for “label”
Small, practical examples. Search by task or narrow things down below.
Associate a label with an input
Give an HTML text input an accessible name using for and id.
HTML✓ Tested
Associate a text field with its label
HTML: Learn how to associate a text field with its label in a complete browser example.
HTML✓ Tested
Attach a descriptive label to a container
Docker / Compose: Attach a descriptive label to a container using a locally available Ubuntu image.
Docker / Compose✓ Tested
Choose a local file through a labeled control
HTML: A file input exposes selected file metadata to the page without providing arbitrary filesystem access.
HTML✓ Tested
Choose labels from a language context
Choose labels from a language context with a small React component and explicit browser behavior.
React✓ Tested
Connect a reusable label using useId
Connect a reusable label using useId with a small React component and explicit browser behavior.
React✓ Tested
Display a label in uppercase without changing its text
CSS: Text-transform changes visual casing while preserving the DOM’s source text.
CSS✓ Tested
Draw a basic rectangle on a labeled canvas
HTML: Canvas requires script to draw pixels; provide alternative content and an accessible label.
HTML✓ Tested
Format a numeric label with leading zeroes
Bash Scripts: Use a constant printf format string and supply values as separate arguments.
Bash Scripts✓ Tested
Format a zero-padded numeric label
Linux Commands: Use printf formatting instead of concatenating a variable number of zeroes.
Linux Commands✓ Tested
Keep a label available without occupying visible layout space
CSS: A clipped one-pixel label remains the input’s accessible name.
CSS✓ Tested
Label a data table
Use a caption and scoped headers for an HTML data table.
HTML✓ Tested