transition
transition
英[tr?n?z??n] 美[tr?n?z???n, -?s??-]
duration
Time
英[dju?re??n] 美[du?re??n]
css transition-duration attribute syntax
Function:The transition-duration attribute specifies the time (in seconds or milliseconds) it takes to complete the transition effect.
Syntax: transition-duration: time
Description: time specifies the time it takes to complete the transition effect (in seconds or milliseconds count). The default value is 0, meaning there will be no effect.
Note: Internet Explorer 10, Firefox, Opera, and Chrome support the transition-duration attribute. Safari supports an alternative -webkit-transition-duration property. Internet Explorer 9 and earlier browsers do not support the transition-duration attribute.
css transition-duration attribute example
<!DOCTYPE html> <html> <head> <style> div { width:100px; height:100px; background:blue; transition-property:width; transition-duration:5s; /* Firefox 4 */ -moz-transition-property:width; -moz-transition-duration:5s; /* Safari and Chrome */ -webkit-transition-property:width; -webkit-transition-duration:5s; /* Opera */ -o-transition-property:width; -o-transition-duration:5s; } div:hover { width:300px; } </style> </head> <body> <div></div> <p>請(qǐng)把鼠標(biāo)指針移動(dòng)到藍(lán)色的 div 元素上,就可以看到過渡效果。</p> <p><b>注釋:</b>本例在 Internet Explorer 中無效。</p> </body> </html>
Click the "Run instance" button to view the online instance