Difference between transform: translate3d (50%, 0,0) and left: 50% in css?

How is the conversion: translate3d (50%, 0,0) different from the left: 50% in css? heres jsfiddle I did.

transform: translate3d(50%,0,0)

and

left:50%;

figure

+4
source share
2 answers

translate3d(50%,0,0) considers the percentage of the element itself, so it is translated from the left half of the element's size.

The left part of the div, which is located absolute in the violin, refers to the div container, which is relatively located, so it left:50%;makes up 50% of this container.

+5
source

Left , ( , width :100%)
transform

, .

+1

Source: https://habr.com/ru/post/1650623/


All Articles