Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

265
Views
How can I make text visible when found with browser search?

I have in a web-page repeated divs which are normally transparent, but are made opaque when the mouse hovers over their parent:

<div class="entry">
  ...
  <div class="info">
    some information text
  </div>
</div>
div.info {
    opacity: 0;
}
.entry:hover div.info {
    opacity: 1;
}

I would now like to make that page searchable through the standard browser "find in page" functionality. That actually works, but if the found text is within such a div.info, it is obviously invisible, too.

Is there a way I can make my div visible not just on hover, but also if it contains found text? Or specify the style of found text, including that is is supposed to be visible?

I looked at the other CSS pseudo-classes, but none of them match my purpose. I also experimented with the pseudo-element ::target-text as an alternative to found text.

Do I have to do this via JavaScript?

over 4 years ago · Santiago Trujillo
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!