css3 - CSS rotation transform causing margin issues with absolute positioning -



css3 - CSS rotation transform causing margin issues with absolute positioning -

in 1 of web pages, have set of buttons i'm rotating when event happens, such 1 of buttons disappears doing transform: rotatex(90deg); , appears doing transform: rotatex(0deg);. have buttons positioned on right side of div has 100% width using absolute position, e.g. position: absolute; right: 10px;

when buttons not transitioning, buttons appear correctly , appear on right side 10 pixels right side of page. however, when transitioning, margins appear move inwards additional 10 pixels if added margin of 10 pixels right.

while isn't visually pleasing, here jsfiddle example. shown, pinkish button 10 pixels right, reddish rotated button additional 10 pixels right.

how can avoid this?

you should add together somewhere position relative, absolute has reference , not whole body.

.buttons { width: 100%; position: relative; }

that prepare weird behaviour

css css3 css-position css-transforms

Comments

Popular posts from this blog

php - Android app custom user registration and login with cookie using facebook sdk -

django - Access session in user model .save() -

php - .htaccess Multiple Rewrite Rules / Prioritizing -