Detailed description of properties The purpose of the transition attribute is to make some CSS properties (such as background) appear with a smooth transition effect. It is a combined attribute that is composed of the following four attributes:
Example: button{ transition: background 1s; -webkit-transition: background 1s; /* Safari */ } When defining transition properties, transition-property and transition-duration are required, and the other two are optional. transition-property and transition-duration transition-property is used to specify the CSS properties for applying transition effects. These properties include (may not be complete):
The transition-duration property is used to set the duration of the transition effect of the specified property, which can be seconds (s) or milliseconds (ms). transition-delay and transition-timing-function transition-delay is used to set the time when the transition effect starts. The default value is 0 and can be seconds (s) or milliseconds (ms). If transition-delay is a negative number, it means that the transition effect starts early. transition-timing-function is used to set the transition effects, which include:
Example: button{ transition: background 1s ease-in-out 2s; -webkit-transition: background 1s ease-in-out 2s; /* Safari */ } Multiple attributes For multiple properties, the effects of each property are separated by commas: button{ transition: background 1s ease-in-out 2s, width 2s linear; -webkit-transition: background 1s ease-in-out 2s, width 2s linear; /* Safari */ } compatibility Internet Explorer 10, Firefox, Opera, and Chrome support the transition property. Safari supports the alternative -webkit-transition property. Internet Explorer 9 and earlier versions do not support the transition property. trigger It should be noted that transition effects require previously defined properties, and transition effects are applied through triggers, such as :hover, :focus, and :active. Summarize The above is what I introduced to you about using the transition attribute in CSS3 to achieve transition effects. I hope it will be helpful to you. If you have any questions, please leave me a message and I will reply to you in time. I would also like to thank everyone for their support of the 123WORDPRESS.COM website! |
<<: Two simple ways to remove text watermarks from web pages
>>: Detailed explanation of the basic usage of VUE watch listener
Table of contents Preface How to implement Vuex f...
Table of contents 1. Unzip 2. Create a data folde...
Background requirements: The ERP system needs to ...
Table of contents 1 Test Environment 1.1 Server H...
Three tables are connected. Field a of table A co...
Normally, when you run a command in the terminal,...
1. To develop web responsively, the page must ada...
Why do we say “usually 1em=16px”? The default tex...
I encountered a little problem when configuring t...
1. Find a suitable version of redis for docker Yo...
This article shares the installation and configur...
Table of contents Linux-Use MyCat to implement My...
Table of contents The dynamic particle effects ar...
You may have set a MySQL password just now, but f...
1. Download cuda10.1: NVIDIA official website lin...