.background { position: relative; width: 100%; z-index: 0; } .canteen { width: 40vw; /* 设置为视口宽度 */ height: 40vw; /* 保持宽高比 */ position: relative; } .canteen img { position: absolute; width: 100%; height: 100%; } .table { width: 100%; height: 100%; position: absolute; top: 0; left: 0; z-index: 2; } .plate { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); z-index: 3; } .chef-hand { position: absolute; top: 0; left: 50%; transform: translateX(-50%); opacity: 0; transition: opacity 0.5s; z-index: 3; } .rice, .meat { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); opacity: 0; transition: opacity 0.5s; z-index: 3; } .rice-mirror, .meat-mirror { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%) scaleX(-1); opacity: 0; transition: opacity 0.5s; z-index: 3; } .chef { position: absolute; bottom: 0; left: 50%; transform: translateX(-50%); z-index: 1; } button { display: block; margin: 20px auto; padding: 10px 20px; font-size: 18px; position: relative; z-index: 10; } .rice_bucket{ position: absolute; bottom: 0; left: 50%; transform: translateX(-50%); z-index: 1; }