I want the div 'expand' to expand to a set height when hovered over and then revert back to the original height of the div on mouse out.
My problem is that the images inside 'expand' needs to remain proportional and thus its height is going to vary depending on the browser width.
So I need some code (html, css, javascript, jQuery, PHP, etc.) that will set the div 'expand' to expand to a preset height on hover and then revert to the height of the image (plus a 5 pixel padding on all sides).
The markup:
<html>
<head>
<style>
.expand{
background-color: red;
height: auto;
padding: 5px;
width: 18%;
}
</style>
</head>
<body>
<div class="expand">
<img src="http://yabooks.ml/Images/The Dmon King.jpg" style="width: 100%;">
<h3>The Demon King</h3>
<h5>Cinda Williams Chima</h5>
<p>jfah;jfhe;jfhwehccneufhea'hfehechceiphf'jfah;jfhe;jfhwehccneufhea'hfehechceiphf'jfah;jfhe;jfhwehccneufhea'hfehechceiphf'jfah;jfhe;jfhwehccneufhea'hfehechceiphf'jfah;jfhe;jfhwehccneufhea'hfehechceiphf'</p>
</div>
</body>
</html>