<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/this-shouldn-t-be-possible-with-css-3qyqdqhg4" -->

---
title: This shouldn&#x27;t be possible with CSS | daily.dev
description: A walkthrough of building a CSS-only hover highlight effect for navigation using the CSS Anchor Positioning API. By assigning an anchor-name to a nav element...
canonical: https://daily.dev/posts/this-shouldn-t-be-possible-with-css-3qyqdqhg4
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: This shouldn&#x27;t be possible with CSS | daily.dev
og:description: A walkthrough of building a CSS-only hover highlight effect for navigation using the CSS Anchor Positioning API. By assigning an anchor-name to a nav element...
og:url: https://daily.dev/posts/this-shouldn-t-be-possible-with-css-3qyqdqhg4
og:image: https://api.daily.dev/og/posts/3QyQDQhG4.png
og:image:alt: This shouldn&#x27;t be possible with CSS
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# This shouldn't be possible with CSS

**[Kevin Powell](https://daily.dev/sources/kevinpowell)** · 2 min read · 1 upvotes · 1 comments

## Summary

A walkthrough of building a CSS-only hover highlight effect for navigation using the CSS Anchor Positioning API. By assigning an anchor-name to a nav element and a pseudo-element, and then reassigning that anchor-name on hover/focus to individual links, the pseudo-element smoothly moves to highlight whichever link is active. The trick relies on anchor positioning's behavior of always targeting the last element with a given anchor name. A spring-based easing from Easing Wizard is added via transition-timing-function to give the movement a bouncy, polished feel. No JavaScript required.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://www.youtube.com/watch?v=OO9doSPdMXg>

## Community discussion

Top comments from developers on daily.dev.

**@yaireo** · 0 upvotes

> what a stupid clickbait title. I'm NOT clicking

## Similar posts on daily.dev

- [Getting Started with Anchor Positioning • Josh W. Comeau](https://daily.dev/posts/getting-started-with-anchor-positioning-josh-w-comeau-gk8wgqtjg) · Josh W Comeau · 83 upvotes · 3 comments

---

Tags: [#css](https://daily.dev/tags/css)

[View this post on daily.dev](https://daily.dev/posts/this-shouldn-t-be-possible-with-css-3qyqdqhg4)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"This shouldn't be possible with CSS","url":"https://daily.dev/posts/this-shouldn-t-be-possible-with-css-3qyqdqhg4","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/this-shouldn-t-be-possible-with-css-3qyqdqhg4"},"datePublished":"2026-03-05T14:14:08.057Z","dateModified":"2026-03-05T14:14:25.324Z","description":"A walkthrough of building a CSS-only hover highlight effect for navigation using the CSS Anchor Positioning API. By assigning an anchor-name to a nav element...","image":"https://i.ytimg.com/vi/OO9doSPdMXg/sddefault.jpg","thumbnailUrl":"https://i.ytimg.com/vi/OO9doSPdMXg/sddefault.jpg","isAccessibleForFree":true,"articleSection":"Kevin Powell","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"Kevin Powell","logo":"https://media.daily.dev/image/upload/s--XK5Rf0kM--/f_auto/v1717745137/logos/kevinpowell","url":"https://daily.dev/sources/kevinpowell"},"commentCount":1,"discussionUrl":"https://daily.dev/posts/this-shouldn-t-be-possible-with-css-3qyqdqhg4","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":1},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":1}],"keywords":"css","timeRequired":"PT2M","video":{"@type":"VideoObject","name":"This shouldn't be possible with CSS","description":"A walkthrough of building a CSS-only hover highlight effect for navigation using the CSS Anchor Positioning API. By assigning an anchor-name to a nav element...","thumbnailUrl":"https://i.ytimg.com/vi/OO9doSPdMXg/sddefault.jpg","uploadDate":"2026-03-05T14:14:08.057Z","duration":"PT2M","url":"https://api.daily.dev/r/3QyQDQhG4","embedUrl":"https://www.youtube.com/embed/OO9doSPdMXg"}}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"Kevin Powell","item":"https://daily.dev/sources/kevinpowell"},{"@type":"ListItem","position":3,"name":"This shouldn't be possible with CSS"}]}
{"@context":"https://schema.org","@type":"WebPage","@id":"https://daily.dev/posts/this-shouldn-t-be-possible-with-css-3qyqdqhg4","comment":[{"@type":"Comment","text":"what a stupid clickbait title. I’m NOT clicking","datePublished":"2026-03-08T09:31:41.738Z","url":"https://daily.dev/posts/3QyQDQhG4#c-za2zf9w4m","author":{"@type":"Person","name":"Yair Even Or","url":"https://daily.dev/yaireo","image":"https://avatars.githubusercontent.com/u/845031?v=4"}}]}
```

