Goncy
Goncy

Reputation: 31

Prevent image rotation to change viewport width

I'm applying rotation to an img element and this is causing the viewport to change it's width, giving the user the possibility of scrolling to sides, there is a way to change this? The images are svgsviewport

Upvotes: 0

Views: 456

Answers (2)

Kevin Jantzer
Kevin Jantzer

Reputation: 9451

Use overflow-x: hidden on the wrapping element

Upvotes: 2

Dylan Stark
Dylan Stark

Reputation: 2395

Wrap the SVG in a <div> styled to be the same height and width as your SVG element and set overflow: hidden on the wrapping element.

The <div> will hide the corners of your SVG as it rotates but none of the inner SVG circle should be clipped.

Upvotes: 1

Related Questions