How to use CSS to make text appear when hovering over a div.

By using the :hover pseudo-class, one can show and hide text on hover using CSS. In the demos below, I’m using the hover pseudo-class along with the background and text color attributes.

Hide Text Until Hover

Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry’s standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.

Dad Jokes

If Dr. Pepper was a doctor, what kind of doctor would he be?

He would be a fizzician.

Why do crabs never give to charity?

Because they’re shellfish..

Why did the elephant have three red tennis shoes and one yellow shoe?

Because he forgot to lift his leg!

Text Module Content

<strong>Lorem Ipsum</strong> is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's <span class="blur-text">standard dummy text</span> ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book.

<style type="text/css">
  span.blur-text{
transition: 0.25s filter linear;
filter: blur(8px);
}
span.blur-text:hover{filter: blur(0px);}
</style>

 

Note

The CSS can be added via the Text Module’s Advanced tab.

Step 1) Under CSS ID & Classes, add your class. In this example enter “blur-text” without the quotes.
Step 2) Under custom CSS, add your CSS. In this example you would add:

  span.blur-text{
transition: 0.25s filter linear;
filter: blur(8px);
}
span.blur-text:hover{filter: blur(0px);}

 

Text Module Content

<h2>Dad Jokes</h2>
If <strong>Dr. Pepper</strong> was a doctor, what kind of doctor would he be? 

He would be a <span class="obscure-text">fizzician</span>.

Why do crabs never give to charity? 

Because <span class="obscure-text">they’re shellfish.</span>.

Why did the elephant have three red tennis shoes and one yellow shoe?

Because he <span class="obscure-text">forgot to lift his leg</span>!

<style type="text/css">
span.obscure-text{
 transition: all .2s ease-in;
  background: #666;
}
span.obscure-text:hover{background: transparent;}
</style>

 

Divi 5 Released

Divi 5 Released

Discover the future of web design with Divi 5, where creativity meets functionality. Elevate your projects with cutting-edge features and seamless integration.Divi 5 marks a significant milestone in the web design industry, offering unparalleled flexibility and power...

Divi Translucent Glass Hover Effect

Divi Translucent Glass Hover Effect

Clinton Eastwood Jr. (born May 31, 1930) is an American actor and film director. After achieving success in the Western TV series Rawhide, Elon Reeve Musk is a businessman and investor. He is the founder, chairman, CEO, and CTO of SpaceX; angel investor, CEO, product...

Improve Time on Site

Improve Time on Site

e've worked hard building our websites. So why is everybody in a hurry to move on instead of sticking around to read our content? Bounce Rates -- The percentage of visitors who fail to engage with more than one page on our site. This is a very...