Non so voi, ma quando si tratta di animazioni e grafica io non scomoderei JavaScript…
codice:
<!doctype html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Esempio</title>
<style type="text/css">
.switchbox {
position: relative;
margin: 5px;
padding: 10px;
width: 500px;
height: 200px;
background: Tan;
}
.switchbox .element1,
.switchbox .element2 {
position: absolute;
bottom: 10px;
left: 10px;
right: 10px;
overflow: auto;
}
.switchbox .element1,
.switchbox:hover .element2 {
height: 180px;
}
.switchbox .element1{
background: Orange;
}
.switchbox .element2{
background: Beige;
height: 0px;
overflow: hidden;
transition: height .5s;
}
</style>
</head>
<body>
<div class="switchbox"> BOX 1
<div class="element1">This one is the first element</div>
<div class="element2">This one is the second element</div>
</div>
<div class="switchbox"> BOX 2
<div class="element1">This one is the first element</div>
<div class="element2">This one is the second element</div>
</div>
<div class="switchbox"> BOX N
<div class="element1">This one is the first element</div>
<div class="element2">This one is the second element</div>
</div>
</body>
</html>