iTechGuides is reader-supported. When you buy through links on our site, we may earn an affiliate commission. As an Amazon Associate I earn from qualifying purchases. Learn more
For a standard crosshair, apply cursor: crosshair to the area where it should appear. If you want a custom shape that follows the pointer or trails behind it, add a separate decorative element and position it with JavaScript. Keep that element out of the way of page controls, respect reduced-motion preferences, and provide a fallback for visitors who do not use a mouse.
Choose the kind of crosshair you need
There are two distinct approaches: use the browser’s built-in crosshair cursor, or create a custom visual that tracks pointer movement. The built-in option is simpler and usually the better starting point. A custom cursor is useful when you need a particular shape, size, or animation.
| Approach | Best for | Tradeoff |
|---|---|---|
CSS cursor: crosshair |
A straightforward crosshair over a specific region | You use the browser-provided appearance rather than defining its shape. MDN’s cursor reference documents the keyword. |
| CSS cursor image or JavaScript-positioned overlay | A custom graphic, a pointer-following effect, or animation | Requires fallback behavior and attention to hit-testing, visibility, motion preferences, and device differences. MDN documents cursor images; see also the guidance on pointer events and reduced motion. |
Apply the native crosshair with CSS
Use the CSS cursor property on the element or region where the crosshair makes sense:
.drawing-area {
cursor: crosshair;
}
For example, a canvas-like drawing area may benefit from a crosshair, while ordinary text and buttons should generally retain cursor behavior that communicates their function. As MDN puts it, “The cursor setting should inform users of the mouse operations that can be performed at the current location, including: text selection, activating help or context menus, copying content, resizing tables, and so on.”
#1 Best Overall
- The next-generation optical HERO sensor delivers incredible performance and up to 10x the power efficiency over previous generations, with 400 IPS precision and up to 12,000 DPI sensitivity
- Ultra-fast LIGHTSPEED wireless technology gives you a lag-free gaming experience, delivering incredible responsiveness and reliability with 1 ms report rate for competition-level performance
- G305 wireless mouse boasts an incredible 250 hours of continuous gameplay on just 1 AA battery; switch to Endurance mode via Logitech G HUB software and extend battery life up to 9 months
- Wireless does not have to mean heavy, G305 lightweight mouse provides high maneuverability coming in at only 3.4 oz thanks to efficient lightweight mechanical design and ultra-efficient battery usage
- The durable, compact design with built-in nano receiver storage makes G305 not just a great portable desktop mouse, but also a great laptop travel companion, use with a gaming laptop and play anywhere
Use a custom cursor image when you need a specific design
CSS can load a cursor image and then name a fallback cursor keyword. The optional two numbers identify the hotspot—the active point in the image—relative to its top-left corner:
.drawing-area {
cursor: url("/images/crosshair.png") 16 16, crosshair;
}
In this example, the hotspot is at coordinate 16, 16. Set the values to match the point in your image that should align with the pointer; omit them if the image’s top-left corner is the intended active point. The fallback keyword after the image is required. User agents commonly limit cursor-image dimensions: MDN recommends 32 × 32 pixels and notes a default restriction of 128 × 128 pixels in Firefox and Chromium. Those documentation notes are not a guarantee for every browser or version.
Rank #2
- HERO Gaming Sensor: Next generation HERO mouse sensor delivers precision tracking up to 25600 DPI with zero smoothing, filtering or acceleration
- 11 programmable buttons and dual mode hyper-fast scroll wheel: The Logitech wired gaming mouse gives you fully customizable control over your gameplay
- Adjustable weights: Match your playing style. Arrange up to five 3.6 g weights for a personalized weight and balance configuration
- LIGHTSYNC technology: Logitech G LIGHTSYNC technology provides fully customizable RGB lighting that can also synchronize with your gaming (requires Logitech Gaming Software)
- Mechanical Switch Button Tensioning: A metal spring tensioning system and metal pivot hinges are built into left and right computer gaming mouse buttons for a crisp, clean click feel with rapid click feedback
Build a pointer-following crosshair with JavaScript
A follow effect uses a normal HTML element as a visual overlay. Give it fixed positioning so its coordinates correspond to the viewport, and disable pointer targeting so it cannot intercept clicks or hover events. This example follows a mouse or pen and keeps a built-in crosshair as the CSS fallback.
Quick wins for a faster PC:
Scan for outdated or missing drivers - takes under a minuteDriver Scan →Repair Windows errors before they cause bigger problemsFix Now →Fix the driver behind crashes, sound loss and screen glitchesFind Drivers →<div class="drawing-area">
Move a mouse or pen over this area.
</div>
<div class="crosshair" aria-hidden="true"></div>
.drawing-area {
min-height: 18rem;
cursor: crosshair;
}
.crosshair {
position: fixed;
left: 0;
top: 0;
width: 24px;
height: 24px;
border: 1px solid currentColor;
border-radius: 50%;
pointer-events: none;
opacity: 0;
transform: translate(-50%, -50%);
z-index: 10;
}
.crosshair::before,
.crosshair::after {
content: "";
position: absolute;
background: currentColor;
}
.crosshair::before {
width: 1px;
height: 34px;
left: 50%;
top: 50%;
transform: translate(-50%, -50%);
}
.crosshair::after {
width: 34px;
height: 1px;
left: 50%;
top: 50%;
transform: translate(-50%, -50%);
}
@media (prefers-reduced-motion: reduce) {
.crosshair {
transition: none;
}
}
const area = document.querySelector(".drawing-area");
const crosshair = document.querySelector(".crosshair");
area.addEventListener("pointermove", (event) => {
if (event.pointerType === "touch") return;
crosshair.style.left = `${event.clientX}px`;
crosshair.style.top = `${event.clientY}px`;
crosshair.style.opacity = "1";
});
area.addEventListener("pointerleave", () => {
crosshair.style.opacity = "0";
});
The Pointer Events API provides a common event model for mouse, pen, and touch. Here, clientX and clientY are viewport coordinates, which pair with position: fixed. The effect is limited to the drawing area, and touch input does not reveal the overlay. If the effect is meant to cover the whole page, attach the movement and leave handlers to an appropriate page-level element instead. See MDN’s Pointer Events guide.
Rank #3
- Next-gen 12,000 DPI HERO optical sensor delivers unrivaled gaming performance, accuracy and power efficiency
- Advanced LIGHTSPEED wireless gaming mouse for super-fast 1 ms response time and faster than wired performance
- Ultra-long battery life gives you up to 250 hours of continuous gaming on a single AA battery
- Lightweight mechanical design and classic shape for maximum maneuverability, durability and comfort
- Compact, portable design with convenient built-in storage for included USB wireless receiver
Keep the overlay decorative
pointer-events: none lets pointer events target the content underneath the overlay instead. That matters for links, buttons, and hover states: the crosshair should not become an interaction blocker. The aria-hidden="true" attribute marks this visual decoration as irrelevant to assistive technology; do not put interactive content inside it.
Do not hide the system cursor prematurely
This example leaves the native cursor available. If you choose to hide it for a custom effect, do so only when the replacement is initialized and visible, and preserve a fallback when JavaScript is unavailable or the device does not support the intended interaction. Otherwise a visitor can lose the visible pointer without gaining a working replacement.
Rank #4
- ICONIC ERGONOMIC DESIGN WITH THUMB REST — PC gaming mouse favored by millions worldwide with a form factor that perfectly supports the hand while its buttons are optimally positioned for quick and easy access
- 11 PROGRAMMABLE BUTTONS — Assign macros and secondary functions across 11 programmable buttons to execute essential actions like push-to-talk, ping, and more
- HYPERSCROLL TILT WHEEL — Speed through content with a scroll wheel that free-spins until its stopped or switch to tactile mode for more precision and satisfying feedback that’s ideal for cycling through weapons or skills
- 11 RAZER CHROMA RGB LIGHTING ZONES — Customize each zone from over 16.8 million colors and countless lighting effects, all while it reacts dynamically with over 150 Chroma integrated games
- OPTICAL MOUSE SWITCHES GEN 2 — With zero unintended misclicks these switches provide crisp, responsive execution at a blistering 0.2ms actuation speed for up to 70 million clicks
Account for motion and different pointer devices
Honor reduced-motion preferences
If you add easing, a trailing animation, or other movement, use the prefers-reduced-motion media feature to remove or simplify it when the visitor’s system requests reduced motion. The CSS example disables transitions under that preference; for a more elaborate effect, apply the same principle to every animation that moves the cursor decoration. See MDN’s reduced-motion reference.
Free tools Windows power users keep installed
One-click scans. No signup required.
Do not assume everyone has a mouse
A mouse-following decoration has little purpose on a touch-only screen. Check event.pointerType when handling Pointer Events, and decide whether the effect should be absent, use a different interaction, or respond to a pen. Pointer Events cover mouse, pen, and touch, but cursor appearance is not uniform across devices. MDN notes that iPadOS uses a circular pointer for pointer devices and that only the text cursor value changes its appearance by default; do not promise that custom cursor styling will look the same on iPadOS as on desktop. See MDN’s Pointer Events guide and cursor reference.
Quick Recap
Best Value
- Pentakill, 5 DPI Levels - Geared with 5 redefinable DPI levels (default as: 500/1000/2000/3000/4000), easy to switch between different game needs. Dedicated demand of DPI options between 500-8000 is also available to be processed by software.
- Any Button is Reassignable - 11 programmable buttons are all editable with customizable tactical keybinds in whatever game or work you are engaging. 1 rapid fire + 2 side macro buttons offer you a better gaming and working experience.
- Comfort Grip with Details - The skin-friendly frosted coating is the main comfort grip of the mouse surface, which offers you the most enjoyable fingerprint-free tactility. The left side equipped with rubber texture strengthened the friction and made the mouse easier to control.
- 5 Decent Backlit Modes - Turn the backlit on and make some kills in your gaming battlefield. The hyped dynamic RGB backlit vibe will never let you down when decorating your gaming space, it would be better with other Redragon accessories with lights on.
- Fatigue Killer with Ergonomic Design - Solid frame with a streamlined and general claw-grip design offers a satisfying and comfortable gaming experience with less fatigue even though after hours of use.
Check visibility and interaction
- Choose a crosshair color and size that remain visible against the region’s backgrounds.
- Keep the decoration from obscuring text or important controls.
- Test that links and buttons beneath it still receive pointer events.
- Ensure the native cursor or another usable fallback remains available if the custom effect cannot run.
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

