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>

 

Gradient Line Test

Gradient Line Test

Gradient Horizontal Line Demo and Code Demo HTML <div id="gradientLine"></div> CSS #gradientLine { height: 2px; width: 100%; display: block; background-color: background: #a90329; background:...