I have an image img.png with dimensions: width=300px, height=200px. This image is in a div container:
<div class='thumbnail'> <img id='imgX' src='img.png'> </div>
And the CSS are:
div.thumbnail {
width: 500px;
height: 300px;
}
div.thumbnail > img {
height: 100%;
display: block;
margin-left: auto;
margin-right: auto;
}
The image is displayed nicely. However, dynamically I can rotate the image with jquery using:
$("#imgX").css("transform","rotate(90deg)");
With this the image is rotated but it's out of the div container. How can I keep it inside?