Hover 1
One way to hover two elements. A problem with this method, though, is that one will overlap the other in its active state.
by Matthew Day
HTML
<div class="wrap">
<div class="vocab english">
<div class="content">
Cat
</div>
</div>
<div class="vocab spanish">
<div class="content">
<h5>El gato diablo</h5>
<p class="grammar">sustantivo</p>
<p class="definition">Es un animal feroz que es capaz de matar a otros animals al morderles la garganta.</p>
</div>
</div>
</div>
CSS
*{
box-sizing: border-box;
margin: 0;
padding: 0;
font-family: Helvetica;
font-size: 14px;
font-weight: 100;
line-height: 1.5em;
color: black;
}
.wrap {
position: relative;
background-image: url("http://www.placekitten.com/g/400/400");
background-repeat: no repeat;
background-position: center center;
background-size: cover;
width: 400px;
height: 400px;
}
.vocab {
position: absolute;
top: 0;
left: -50%;
width: 100%;
height: 100%;
transition: all 1s ease;
border: 1px solid red;
}
.vocab.spanish {
left: 50%;
border: 1px solid blue;
}
.vocab:hover {
left: 0;
}
.content {
float: left;
width: 50%;
}
.spanish .content {
float: right;
}
h5 {
padding-top: 30px;
text-transform: uppercase;
letter-spacing: .6px;
}
.grammar {
font-style: italic;
}
.definition {
padding-top: 20px;
}