I have the following html that displays an img inside a bootstrap 3 panel body.
I needed to rotate the image -90 degrees, and I used the answers to this question : CSS: rotate image and align top left to be able to align the rotated image to the top of the panel.
Note that the image is a long rectangle and not a square, so a 90 degree rotation will greatly change width/height.
<div class="panel-body">
<div id="media_content">
<img class="img-responsive rotate270" src="dessin-3.jpg">
</div>
</div>
.rotate270 {
-webkit-transform: translateX(-100%) rotate(-90deg); /* Safari */
-moz-transform: translateX(-100%) rotate(-90deg); /* Firefox 3.6 Firefox 4 */
-ms-transform: translateX(-100%) rotate(-90deg); /* IE9 */
-o-transform: translateX(-100%) rotate(-90deg); /* Opera */
transform: translateX(-100%) rotate(-90deg); /* W3C */
-webkit-transform-origin: top right;
-moz-transform-origin: top right;
-ms-transform-origin: top right;
-o-transform-origin: top right;
transform-origin: top right;
}
Now, my problem is that the image is drawn over the bottom of that panel, as it seems that the panel is not "informed" of the transformed vertical size of the image.
I'm looking for ways to have the panel adjust its height dynamically, because I'll have a button that lets the user rotate the images 90/180/270° as needed. (Right now I hardcoded the rotation as a CSS class...)
thanks !