惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

F
Full Disclosure
WordPress大学
WordPress大学
小众软件
小众软件
Cloudbric
Cloudbric
AWS News Blog
AWS News Blog
腾讯CDC
量子位
人人都是产品经理
人人都是产品经理
大猫的无限游戏
大猫的无限游戏
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
V
Vulnerabilities – Threatpost
Scott Helme
Scott Helme
Hugging Face - Blog
Hugging Face - Blog
博客园_首页
C
CXSECURITY Database RSS Feed - CXSecurity.com
The Hacker News
The Hacker News
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
IT之家
IT之家
Jina AI
Jina AI
Attack and Defense Labs
Attack and Defense Labs
S
SegmentFault 最新的问题
Simon Willison's Weblog
Simon Willison's Weblog
The Cloudflare Blog
阮一峰的网络日志
阮一峰的网络日志
T
Tailwind CSS Blog
Last Week in AI
Last Week in AI
博客园 - 【当耐特】
Google Online Security Blog
Google Online Security Blog
美团技术团队
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
V
Visual Studio Blog
罗磊的独立博客
L
LINUX DO - 最新话题
博客园 - Franky
博客园 - 叶小钗
Apple Machine Learning Research
Apple Machine Learning Research
The Last Watchdog
The Last Watchdog
J
Java Code Geeks
AI
AI
C
Cisco Blogs
酷 壳 – CoolShell
酷 壳 – CoolShell
C
Cyber Attacks, Cyber Crime and Cyber Security
Cisco Talos Blog
Cisco Talos Blog
博客园 - 三生石上(FineUI控件)
雷峰网
雷峰网
Help Net Security
Help Net Security
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
云风的 BLOG
云风的 BLOG
I
Intezer
S
Securelist

Stefan Judis Web Development

Web Weekly #193 Web Weekly #192 Web Weekly #191 Web Weekly #190 Web Weekly #189 Web Weekly #188 Intl can localize units, too! The scope of type guards and assertion functions Web Weekly #187 Web Weekly #186 Web Weekly #185 New lines are removed from WHATWG URLs Web Weekly #184 Nobody owes you anything How to scale elements and their layout with CSS "zoom" Notes on relying on the ARIA Authoring Practices Guide Web Weekly #183 Web Weekly #182 Web Weekly #181 Web Weekly #180 ARIA roles can remove their children’s semantics Clean up your Mac with open source The Trust Equation Firefox DevTools hides unreferenced CSS variables
How to style the found search / "find in page" substrings
Stefan Judis · 2026-02-02 · via Stefan Judis Web Development

Published at

Updated at

Reading time
2min

This post is part of my Today I learned series in which I share all my web development learnings.

Chrome 144 shipped new CSS pseudo-elements!

::search-text {
  background: var(--blue);
  color: white;
}

::search-text:current {
  background: var(--blue-darker);
  color: white;
  text-decoration: currentColor solid underline;
}

The classes are so new that there aren't MDN pages yet, but I'm super excited about this tiny search improvement.

I'm pretty quick with hitting CMD + F because often I can't be bothered with using the provided site search (if there is one). However, sometimes it's hard to understand what's currently selected if you're looking at multiple matching substrings.

Today I learned, this is a Chrome/Firefox problem because Safari's "find in page" feature adds an overlay while highlighting the current substring.

Find in page in Safari showing highlights for all matching strings while marking the currently selected one.

This looks great, but I won't switch browsers for a better in-page search experience. So what about Chrome and Firefox?

::search-text allows you to style the found strings to follow your site's style. This is good stuff but not really helping with understanding the currently selected search string. This is where ::search-text:current comes into play. Check this out!

Hit "CMD + F" and search for "doggo"!

Doggo ipsum heckin good boys and girls ruff floofs. Doggo such treat smol you are doin me a concern blop wow such tempt stop it fren, puggo stop it fren wow very biscit borkdrive. Aqua doggo pupperino much ruin diet borkdrive heckin good boys...

If you're on Chrome 144 right now, search the page for "doggo"! The matching strings in the component above are matching my site's colors and you can now see which dog is the selected search entry. It doesn't look as fancy as the Safari overlay but I'll buy it!

Find in page highlighting all strings in blue and the currently matching one in black.

Highlighting "find in page" entries isn't the most groundbreaking feature in the world, but I'm excited because I think it'll make my search experience way better! Apparently, there's no clear thumbs up from Mozilla yet, but let's hope that we'll get this improvement on the web.

If you want to dive deeper, here are some more resources:

If you enjoyed this article...

Join 6.5k readers and learn something new every week with Web Weekly.

Stefan standing in the park in front of a green background

Related Topics

Related Articles