I want to rotate a picture (90 degrees) that is between two boxes. The problem is that the picture overlaps the two boxes in this case.
Example 1: Wrong formatting
CSS:
.box{
height:50px;
width:200px;
background-color:blue;
}
HTML:
<div class='box'>Top</div>
<img style='transform: rotate(90deg);' src='https://cdn.pixabay.com/photo/2017/12/10/20/56/feather-3010848_960_720.jpg' width='200px'>
<div class='box'>Bottom</div>
Example 2: Desired formatting
There is a solution, but I can not use it because "image-orientation" is not recognized by all browsers (especially mobile devices):
<div class='box'>Top</div>
<img style='image-orientation: 90deg;' src='https://cdn.pixabay.com/photo/2017/12/10/20/56/feather-3010848_960_720.jpg' width='200px'>
<div class='box'>Bottom</div>
Is there any other solution that a rotated image does not overlap other elements? Or is there any alternative for image-orientation that works with all browsers?