- 调整间距以适应更多图标 */ #right-icon1 { top: 10%; } #right-icon2 { top: 25%; } #right-icon3 { top: 40%; } #right-icon4 { top: 55%; } #right-icon5 { top: 70%; } #right-icon6 { top: 85%; } /* 图标内容样式 */ .icon-content { text-align: center; padding: 2px; width: 100%; } .icon-content img { /* 确保图片尺寸填满整个容器 */ width: 100%; height: 100%; /* 关键属性:保持图片比例并裁剪多余部分 */ object-fit: cover; border-radius: 4px; /* 移除图片边框 */ border: none; outline: none; } .icon-title { font-size: 12px; margin-top: 5px; color: #333; } /* 关闭按钮 */ .close-btn { position: absolute; top: -8px; right: -8px; background: rgba(0, 0, 0, 0.7); color: white; border: none; width: 20px; height: 20px; border-radius: 50%; font-size: 12px; cursor: pointer; line-height: 1; display: block; } .close-btn:hover { background: rgba(0, 0, 0, 0.9); } /* 响应式设计 */ @media (max-width: 1024px) { .floating-icon { width: 90px; height: 90px; } .left-icon { left: 10px; } .right-icon { right: 10px; } } @media (max-width: 768px) { .floating-icon { width: 80px; height: 80px; } } @media (max-width: 480px) { .floating-icon { width: 70px; height: 70px; } .icon-title { font-size: 10px; } } /* 动画效果 */ @keyframes fadeIn { from { opacity: 0; transform: translateY(-20px); } to { opacity: 1; transform: translateY(0); } } .floating-icon { animation: fadeIn 0.5s ease-out; }