Effect How to - Change text on hover








Question

We would like to know how to change text on hover.

Answer


<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Unbenanntes Dokument</title>
<style>
.date-text {<!-- w  ww  .  j  av a  2  s  .co m-->
    display: none;
}
.date:hover .date-text {
    display: inline;
}
.date:hover .arc {
    display: none;
}
</style>
</head>
<body>
    <div class="date">
        <div class="date-text">date1</div>
        <div class="arc">text 1</div>
    </div>
    <div class="date">
        <div class="date-text">date2</div>
        <div class="arc">text 2</div>
    </div>
    <div class="date">
        <div class="date-text">date3</div>
        <div class="arc">text 3</div>
    </div>
</body>
</html>

The code above is rendered as follows: