css - Difference between transform: translate and position:relative;? -


In the form of the title, what are the differences between conversions: Translation (X, Y) and Position: Relative.

Since they both meet the same thing (position element), then how do they differ in purpose and application?

I have read an article about "Transform: Containing Elements Using Translation"; Said that it is better to use "transforming" due to GPU and customizable reason, but I do not really see the problem because it is not a big deal, if you only retain one element and animate it Are not.

So in the end, they are both different and in what way?

Really depends on translation while status Property is.

It is said that the browser supports it by using translations

but not all browsers support it,

Therefore, if you want to provide comprehensive browser support, CSS2 position is definitely better,

while conversion: translation () is the future.


Comments

Popular posts from this blog

python - Overriding the save method in Django ModelForm -

html - CSS autoheight, but fit content to height of div -

qt - How to prevent QAudioInput from automatically boosting the master volume to 100%? -