transform-* properties, such as opacity and some other rendering-related properties, do not inherit the inheritance value in CSS. Instead, they apply visual changes to the element as a whole, including all its descendants. Apply something like transform: none; these descendants have no visible effect, it only means that these elements do not transform on their own, but they are still converted with the parent element - not because they inherit its style, but because they are part of its appearance.
The only way to visually โcancelโ the transformation of the parent element for the descendant (that is, to make it look like it is not transformed) is to specifically convert it so that the result of this transformation looks from this point of view the same as it would look without transformation at all. To make this possible, the transformed element itself and all intermediate ancestors of this element must have transform-style: preserve-3d . The necessary โcompensatingโ transformation can be calculated from the resulting three-dimensional scene or simply constructed by adjusting the transformation values โโthrough trial and error, for example.
.items{ ... transform: translate3d(-51px, 11px, 29px) rotateX(-45deg); transform-origin: 50% 100% 0px; }
(see JSfiddle ).
Unfortunately, this workaround is not compatible with overlow:hidden , because it (along with some other properties ) effectively removes transform-style: preserve-3d . So, if you need to fix the overflowed parts of the transformed element and "cancel" the transformation of its part at the same time, the only solution that is right for you is to organize the code so that this part is not a descendant of the transformed element anymore.
source share