CSS transition 示例

CSS transition1 个文件更新于 2026-04-06
html公开前 25 行,完整代码需登录
<!DOCTYPE html>
<html>
<head>
  <style type="text/css">
    .box {
      width: 100px;
      height: 100px;
      background-color: #3498db;
      transition: all 0.3s ease 0s;
      margin: 20px;
      cursor: pointer;
    }
    
    .box:hover {
      width: 200px;
      height: 200px;
      background-color: #e74c3c;
      transform: rotate(45deg);
    }
    
    .button {
      padding: 10px 20px;
      background-color: #2ecc71;
      color: white;
      border: none;

登录后可以查看完整源码、在线编辑并实时预览运行效果。