首页
极刻
圈子
教程
开源
登录 / 注册
返回教程:CSS 参考手册
TRY RUN / 在线示例
CSS 参考手册 转换效果 - 更改两个属性
CSS 参考手册 转换效果 - 更改两个属性
源代码
运行
<!DOCTYPE html> <html> <head> <style> div { width:100px; height:100px; background:red; transition-property:width,height; transition-duration:2s; /* Safari */ -webkit-transition-property:width,height; -webkit-transition-duration:2s; } div:hover { width:300px; height:300px; } </style> </head> <body> <p><b>Note:</b> This example does not work in Internet Explorer 9 and earlier versions.</p> <div></div> <p>Hover over the div element above, to see the transition effect.</p> </body> </html>
运行结果