TipsBlocks Web Technique Library

PRACTICAL WEB TIP

← Back to library

Crosshair Navigation Mark

Short crosshair marks enter from the corners to pinpoint a hovered menu item.

Live Demo

Hover over the element or use Tab to focus.

Source Code

Copy the HTML, CSS or JavaScript you need for your project.

HTML
<nav class="tbx-1117" aria-label="Sample menu"><a href="#about">ABOUT<span class="tbx-1117__corners" aria-hidden="true"></span></a><a href="#service">SERVICE<span class="tbx-1117__corners" aria-hidden="true"></span></a><a href="#contact">CONTACT<span class="tbx-1117__corners" aria-hidden="true"></span></a></nav>
CSS
.tbx-1117{width:min(287px,100%);display:flex;flex-direction:column;gap:8px;padding:12px;background:#192d3b;border-radius:8px;font-family:system-ui,sans-serif}.tbx-1117 a{position:relative;display:flex;align-items:center;justify-content:center;height:43px;color:#cfdee5;text-decoration:none;font-size:11px;letter-spacing:.18em;font-weight:800;transition:color .3s,background .3s}.tbx-1117__corners{position:absolute;inset:4px 8px;pointer-events:none;opacity:0;transform:scale(.88);transition:transform .36s,opacity .36s;background:linear-gradient(#e8b17b,#e8b17b) left top/11px 2px no-repeat,linear-gradient(#e8b17b,#e8b17b) left top/2px 11px no-repeat,linear-gradient(#e8b17b,#e8b17b) right top/11px 2px no-repeat,linear-gradient(#e8b17b,#e8b17b) right top/2px 11px no-repeat,linear-gradient(#e8b17b,#e8b17b) left bottom/11px 2px no-repeat,linear-gradient(#e8b17b,#e8b17b) left bottom/2px 11px no-repeat,linear-gradient(#e8b17b,#e8b17b) right bottom/11px 2px no-repeat,linear-gradient(#e8b17b,#e8b17b) right bottom/2px 11px no-repeat}
.tbx-1117 a:is(:hover,:focus-visible){color:#fff;background:#263f50}.tbx-1117 a:is(:hover,:focus-visible) .tbx-1117__corners{opacity:1;transform:scale(1)}.tbx-1117 a:focus-visible{outline:2px solid #e8b17b;outline-offset:1px}@media(prefers-reduced-motion:reduce){.tbx-1117 *{transition:none!important}}

How to Use

Insert the HTML and add the CSS to your stylesheet. Adjust colors and sizes and avoid class conflicts.

Use Case

Useful for navigation menus and company websites.

Technical Notes

Keep controls usable on touch devices. Test keyboard focus and reduced-motion preferences.

Mobile:Ensure the interactive content remains accessible without hover on touch devices.

Browser:Uses modern CSS. Check behavior in the browsers you support.

Reduced Motion:Check that prefers-reduced-motion is respected.