# Align Diagonal Guides

![Vertical rails follow the content edges and meet mirrored diagonals at small hollow squares.](assets/preview.jpg)

Anchor a small number of guides to elements that already form a grid. Align the first rail to the left edge of the header and lower controls, the last rail to their right edge, and the inner pair to the type or image column.

## Lay out the connections

1. Add [the guide fragment](assets/guides.html) as a direct child of a positioned .guide-frame. Load [guides.css](assets/guides.css). Give content a higher stacking level. The overlay ignores pointer input and is hidden from assistive technology.
2. Share --edge with the actual controls and set --inner-left and --inner-right on .guides. The right value is the inset from the right. For a centered max-width container, use the larger of its gutter and half the unused width. For measured layouts, subtract the frame rectangle before writing CSS lengths. Update after fonts, resize and breakpoint changes.
3. Start a connector half a CSS pixel inside the outer 1px rail. Its width is the inner inset minus the outer inset. Use a percentage SVG line with no viewBox so its endpoints follow the span without stretching the dash pattern. Mirror the wrapper on the right and below.
4. Center hollow 6px squares on both endpoints with a 50% translation. Use the same stroke color as the line. Keep diagonals quieter than rails and hide the affected connector if a menu or projection occupies that region.
5. For narrow frames collapse a pair if there is no usable span. Shorten the diagonal height before moving the content. Limit animation to the entry stroke and a subtle passing highlight. Honor reduced motion.

## Check

Resize through the mobile breakpoint and a wide monitor. Compare each endpoint to the center of its rail within half a CSS pixel. Check at 125% zoom and 2× pixel density, expand a popover, and click through the diagonal. No extra horizontal scrolling should appear.

---

Copyright (c) 2026 Meng To

The license files are attached. [MIT](https://knowen.md/f/3c02f208-fea4-4055-a09c-593a4f764a38)

The attached ZIP contains the pinned supporting files cleared for import. Applicable license notices are attached or included when cleared.