CSS Grid Overlap Demo - Online Layered Layout Techniques
Place multiple grid items into the same cells to create overlapping layouts. Learn the technique visually. Copy code.
UD5 Toolkit
A live demonstration of focus trapping & restoration — an essential accessibility (A11y) pattern for modals and dialogs. Open the dialog below and navigate with Tab Shift+Tab Esc to see the trap in action.
Click the button below to launch the demo dialog
Use Tab to navigate forward · Shift+Tab backward · Esc to close
document.activeElement (the trigger button). When the dialog closes — whether by Esc, clicking the backdrop, or activating a close button — focus is programmatically moved back to that saved element. This maintains the user's context and prevents disorientation. Without focus restoration, a keyboard user might be dumped at the top of the page, forcing them to tab all the way back.
<body>.aria-modal="true" — screen readers may not announce the modal context correctly.a[href] — anchor tags with an href attributebutton:not([disabled]) — enabled buttonsinput:not([disabled]):not([type="hidden"]) — visible, enabled inputsselect:not([disabled]) — enabled select dropdownstextarea:not([disabled]) — enabled textareas[tabindex]:not([tabindex="-1"]) — elements with explicit non-negative tabindex[contenteditable="true"] — editable content regionsdetails > summary — interactive summary elementsaudio[controls], video[controls] — media controlsdocument.activeElement in the console to confirm focus location.<dialog> element (supported in all modern browsers) provides built-in focus trapping when opened with .showModal(). It automatically traps focus, handles Esc dismissal, and manages backdrop rendering. However, for complex scenarios (nested modals, animated transitions, or custom styling), many developers still implement custom focus traps using JavaScript. Libraries like focus-trap, a11y-dialog, and framework-specific solutions (React Aria, Vue A11y Dialog) provide robust implementations that handle edge cases like iframes and Shadow DOM.
aria-modal="true" is an ARIA attribute that tells screen readers that content behind the dialog is inert and should not be interacted with. It's a semantic/declarative hint for assistive technology. A focus trap is the programmatic enforcement — it physically prevents keyboard focus from leaving the dialog by intercepting Tab keystrokes. Both work together: aria-modal informs the screen reader about the modal context, while the focus trap ensures keyboard-only users (with or without a screen reader) cannot accidentally navigate out. Using one without the other creates an incomplete accessibility implementation.
Place multiple grid items into the same cells to create overlapping layouts. Learn the technique visually. Copy code.
Control image‑orientation: from-image vs none. See how the browser interprets EXIF rotation. Fix portrait photos.
Paste HTML and detect elements with aria‑hidden='true' that contain focusable children. An easy a11y win to fix.
Experiment with scroll‑state container queries to style elements when they are stuck, snapped, or overflowed. Experimental.
Hover over tiles to see every CSS cursor value in action. Quick visual reference for choosing the right UI feedback.
Configure how your PWA launches: focus existing or create new. Test with the launch_handler manifest field.
Build a horizontal scroll‑snap container with configurable snap‑type and alignment. Perfect for image galleries.
Compare all CSS easing presets side by side on a bouncing ball. See which curve fits your UI animation.
Query the permission state of camera, microphone, geolocation, and more. See the response and learn the API.
Process audio faster than real‑time with OfflineAudioContext. Apply filters and export the result. Dev tool.
Drop files onto a zone and see a preview with name, size, and type. Copy the JavaScript pattern for your site.
Demonstrate how to add custom headers and POST‑like functionality to EventSource using a polyfill. Code and example.
Scroll a container and see how sticky elements behave. Adjust top, bottom, and scroll margins. Copy the code.
See how overflow: visible, hidden, scroll, and auto behave with real content. Clone to test with your text.
Try all object‑fit values (fill, contain, cover, scale‑down) on an image. Adjust object‑position. Copy the CSS.
See the difference between clone and slice on inline boxes that break across lines. Useful for multi‑line headings.
Use CSS masks and fixed backgrounds to create a unique parallax reveal effect. Copy the code. No JavaScript.
Render the classic Stanford Bunny with a basic WebGPU pipeline. Rotate and zoom. Check if your browser supports WebGPU.
See how scroll‑padding and scroll‑margin affect the position of elements when using anchor links or scroll‑snap. Visual.
See how align‑items: baseline works in grid to align different font sizes on the same baseline. Visual guide.
Test the experimental Translation API to translate text between languages directly in the browser, without cloud calls. Check support and copy the JavaScript starter.
Apply a convolution filter (blur, sharpen) using a Web Worker. See the UI stay responsive while processing. Learn multithreading in the browser.
Toggle scrollbar‑gutter: stable to reserve space for the scrollbar and avoid content jumps. Visual demo with two columns.
View all CSS system colors (Canvas, ButtonFace, GrayText) as swatches. Click to copy. For forced‑colors adaptation.
Simulate reduced motion preference and test your animations. Copy the media query snippet. Keep your users safe.
Acquire and release locks across tabs. Prevent race conditions in IndexedDB or localStorage. Visual queue and lock state.
Register a periodic background sync to fetch fresh data even when the tab is closed. Understand the API and limits.
Test the Fullscreen API: request fullscreen on a colored div, detect changes, and copy the JavaScript boilerplate.
See the View Transitions API in action. Cross‑fade and morph between two states. Copy the JavaScript starter code.
Find safe mixing ratios for the classic elephant toothpaste demonstration. Volume adjustments for different container sizes.