How to Build Interactive Image Hotspots, Pulsing Pins & Product Tours in CSS
To build responsive image hotspots in CSS, place pins inside a position: relative container wrapping your image and position each pin using percentage coordinates (top: 45%; left: 62%). This guarantees pins stay anchored to the exact visual target regardless of viewport resizing. Create pulsing radar rings using ::before and ::after pseudo-elements animated with transform: scale(2.5) and opacity: 0. Reveal feature details on :hover or :focus-visible using CSS tooltips.
Step 1: Percentage-Based Coordinate Anchoring
Never position image hotspots using fixed pixel units like top: 140px; as soon as the image scales down on mobile, the pin drifts away from its target. Using percentage coordinates (left: 45%; top: 30%) combined with transform: translate(-50%, -50%) locks pins to their exact anchor landmark permanently.
.hotspot-container {
position: relative;
display: inline-block;
width: 100%;
}
.hotspot-pin {
position: absolute;
/* Percentage coordinates match visual anchor */
left: 64.5%;
top: 38.2%;
transform: translate(-50%, -50%);
cursor: pointer;
}
Step 2: Pulsing Radar Wave Ripple Animation
To draw user attention to clickable feature callouts, animate a concentric radar wave using pseudo-elements on the pin. Scaling from 1x to 2.8x with decreasing opacity creates an authentic radar ping.
.hotspot-pin::after {
content: "";
position: absolute;
inset: -6px;
border-radius: 50%;
border: 2px solid #38bdf8;
animation: radarWave 2s cubic-bezier(0, 0, 0.2, 1) infinite;
pointer-events: none;
}
@keyframes radarWave {
0% { transform: scale(0.8); opacity: 1; }
100% { transform: scale(2.6); opacity: 0; }
}
Step 3: Interactive Feature Callout Tooltip Card
When the user hovers over or focuses a pin, reveal a styled feature card. Use CSS Anchor Positioning or a nested popover box styled with frosted glass and high contrast text.
.hotspot-popover {
position: absolute;
bottom: calc(100% + 10px);
left: 50%;
transform: translateX(-50%) translateY(4px);
width: 200px;
background: rgba(18, 15, 30, 0.9);
backdrop-filter: blur(12px);
border: 1px solid rgba(255, 255, 255, 0.15);
border-radius: 8px;
padding: 12px;
opacity: 0;
pointer-events: none;
transition: opacity 0.2s ease, transform 0.2s ease;
}
.hotspot-pin:hover .hotspot-popover,
.hotspot-pin:focus-visible .hotspot-popover {
opacity: 1;
pointer-events: auto;
transform: translateX(-50%) translateY(0);
}
Step 4: Accessible Keyboard Navigation & ARIA Disclosure
Hotspots must never be plain unclickable <div> tags. Mark each hotspot pin as a <button type="button"> with an explicit aria-label and aria-expanded attribute so screen readers and keyboard users can navigate product tour steps seamlessly.
<button type="button" class="hotspot-pin" aria-label="Feature: Optical Sensor" aria-expanded="false">
<span class="pin-dot"></span>
<div class="hotspot-popover" role="region">
<h4>Optical Sensor</h4>
<p>Up to 26,000 DPI sensitivity.</p>
</div>
</button>
Next-Level Addons: Elevating Your Implementation
Take this technique further by combining it with complementary design token studios and animation tools:
A trick I use in almost every project: don't fight specificity battles with !important. Leverage modern CSS cascade layers (@layer) and CSS variables as design tokens—it makes dark/light theme switching and responsive tuning effortless.
Frequently Asked Questions
Practical answers to common implementation questions, browser quirks, and performance tips.
Why should image hotspots be positioned with percentages instead of pixels?
Images scale responsively across desktop and mobile screens. Percentage coordinates (e.g. top: 50%; left: 70%) maintain their exact proportional position on the image regardless of screen width.
Why do hotspot pins need transform: translate(-50%, -50%)?
By default, top and left align the top-left corner of the pin. Adding transform: translate(-50%, -50%) aligns the pin's center point with the target coordinate.
How can I ensure hotspot pins are accessible to keyboard users?
Render each pin as a native <button> element with an explicit aria-label. Keyboard users navigating with the Tab key can focus the pin and press Enter or Space to open the feature callout.
How do I prevent hotspot popovers from clipping off the edge of the image?
Detect when a pin is near the right edge and switch the popover alignment class from transform: translateX(-50%) to right: 0 or use CSS Anchor Positioning.
Can image hotspots be built without any JavaScript?
Yes. Pure CSS can handle percentage positioning, radar wave animations, and hover/focus-visible tooltip reveals without a single line of JavaScript.