A brief analysis of the differences and functions between transition, transform, and translate in CSS3

A brief analysis of the differences and functions between transition, transform, and translate in CSS3

transform and translate

Transform refers to transformation and deformation. It is a CSS3 attribute, just like other width and height attributes.

translate is the attribute value of transform, which means that the element is transformed in 2D. 2D transformation means that the element moves in the direction of the x-axis and in the direction of the y-axis from the current position (0,0).

For example:

transform: translate(0,100%) means moving the element downward along the y-axis from its current position by the entire height of the element.

transform: translate(-20px,0) means moving 20px to the left along the x-axis from the current position of the element

transform has many other property values, translate3D (3D transformation), scale (2D scaling) and other transformation methods.

transition

transition is the animation process of changing one set of CSS properties to another set of properties within a certain period of time. Can be used to achieve dynamic effects, css3 properties

Syntax transition: The property to be transformed The time required to transform Control the speed of the animation Change The delay time after which the animation starts to execute

The transition property is written in the initial style, not in the ending style, which is the style that defines the appearance of the element before the animation starts. You only need to set a transition on an element once, and the browser will take care of animating from one style to another.

For example:

transition:width 2s;

transition:translate 2s;

Transtion: all 2s.

Summarize

This concludes this article about the differences and functions of transition, transform, and translate in CSS3. For more relevant css3 transition, transform, and translate content, please search 123WORDPRESS.COM’s previous articles or continue to browse the following related articles. I hope that everyone will support 123WORDPRESS.COM in the future!

<<:  Conflict resolution when marquee and flash coexist in a page

>>:  Vue implements small notepad function

Recommend

Four ways to switch tab pages in VUE

Table of contents 1. Static implementation method...

The unreasonable MaxIdleConns of MySQL will cause short connections

1 Background Recently, some performance issues ha...

In-depth understanding of Vue's plug-in mechanism and installation details

Preface: When we use Vue, we often use and write ...

Detailed explanation of JavaScript's built-in Date object

Table of contents Date Object Creating a Date Obj...

MySQL optimization connection optimization

In the article MySQL Optimization: Cache Optimiza...

MySQL 5.7.18 Archive compressed version installation tutorial

This article shares the specific method of instal...

Solution to nginx-ingress-controller log persistence solution

Recently I saw an article on a public account tha...

JavaScript implements checkbox selection function

This article example shares the specific code of ...

How to display web pages properly in various resolutions and browsers

The key codes are as follows: Copy code The code i...

Detailed explanation of Vue router routing guard

Table of contents 1. Global beforeEach 1. Global ...

Incredible CSS navigation bar underline following effect

The first cutter in China github.com/chokcoco Fir...

Introduction to Common XHTML Tags

<br />For some time, I found that many peopl...

vue-router hook function implements routing guard

Table of contents Overview Global hook function R...

Specific usage of CSS compound selectors

Intersection Selector The intersection selector i...

js implements shopping cart addition and subtraction and price calculation

This article example shares the specific code of ...