I need help rotating an image by 90 degrees that is positioned between two boxes. The issue I am facing is that the rotated picture overlaps with the two boxes in this scenario.
Example 1: Incorrect 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: Preferred formatting
There is a workaround available, but it cannot be used universally as "image-orientation" may not be supported by all browsers, especially on 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>
Are there any other solutions to prevent a rotated image from overlapping other elements? Or is there an alternative for image-orientation that is universally supported by all browsers?