Dev Helpers

CSS / Accessibility and international layouts

Always allow selection of a reference code

Dev Helpers · May 30, 2026

Reference codes often live inside cards with restricted selection. A local user-select rule lets the reader copy an identifier without dragging other text.

Worked example

<style>
  .demo {
    user-select: all;
  }
</style>
<code class="demo">ORDER-2026-014</code>

Implementation notes

Selection and clipboard behaviour are distinct. Selecting the displayed code should retain meaningful characters even when decorations are provided by CSS.

Try it yourself

Select a code with both a mouse and a touch press.

Open the CSS example →

Editorial date May 30, 2026 · Published December 6, 2026

Related articles

Fluid width with a maximum

A fluid container needs a small-screen width and a large-screen maximum. Outer gutters should remain visible at both extremes.

Square aspect ratio

A square ratio reserves equal sides even before media loads. Fit rules decide whether rectangular content is cropped or letterboxed.