Results for “relative”
Small, practical examples. Search by task or narrow things down below.
Resolve a relative URL against a base
TypeScript: A trailing slash makes the final base path component a directory.
TypeScript✓ Tested
Resolve relative links against an explicit base
HTML: A base href changes how relative document URLs are resolved.
HTML✓ Tested
Size a child relative to its containing block
CSS: A percentage width is based on the containing block’s available width.
CSS✓ Tested
Size a panel relative to viewport height
CSS: Viewport height units track the browser viewport rather than the parent element.
CSS✓ Tested
Create a symbolic link
Create a relative symbolic link to a file and inspect its target with readlink.
symlink✓ Tested
Create a ZIP archive from a file
Python: Give a ZIP entry a relative archive name instead of exposing its source directory.
Python✓ Tested
Create an archive from an explicit file list
Linux Commands: Use tar -T for a controlled list of relative archive members.
Linux Commands✓ Tested
Enumerate matching files recursively
C#: Sort relative filenames when reproducible traversal output is required.
C#✓ Tested
Find matching files recursively
Python: Use rglob and sorted relative paths for a reproducible recursive file listing.
Python✓ Tested
Group matching values while preserving their order
C++: stable_partition keeps the relative order within both predicate groups.
C++✓ Tested
List regular files recursively in sorted order
C++: Collect relative paths before sorting because directory iteration order is unspecified.
C++✓ Tested
Normalize a path without requiring it to exist
Linux Commands: Use GNU realpath -m and relative-to to normalize dot segments.
Linux Commands✓ Tested