切换搜索
搜索
切换菜单
notifications
切换个人菜单
查看“模板:卡片/Cards.css”的源代码
来自Hokubu Wiki
查看
阅读
查看源代码
查看历史
associated-pages
模板
讨论
更多操作
←
模板:卡片/Cards.css
因为以下原因,您没有权限编辑本页:
您请求的操作仅限属于该用户组的用户执行:
用户
此页面已被保护以防止编辑或其他操作。
您可以查看和复制此页面的源代码。
/* ====================== 基础布局与网格系统(保持不变) ====================== */ .home-grid { display: grid; grid-template-columns: repeat(3, minmax(300px, 1fr)); gap: 20px; padding: 20px; box-sizing: border-box; } @media (min-width: 1200px) { .home-grid { grid-template-columns: repeat(4, minmax(300px, 1fr)); } } @media (max-width: 1024px) { .home-grid { grid-template-columns: repeat(2, minmax(280px, 1fr)); } } @media (max-width: 768px) { .home-grid { grid-template-columns: 1fr; padding: 10px; } .home-card .transport-card { height: 150px; /* 图片高度仍可固定,不影响正文 */ } } @media (max-width: 480px) { .home-card__header { font-size: 1rem; } .home-card__text, .home-link { padding: 10px; } } /* ====================== 卡片主体样式(核心修改) ====================== */ .home-card { overflow: hidden; background: #f5f7fa; border: 1px solid #dee2e6; border-radius: 15px; box-shadow: 0 3px 6px rgba(0,0,0,0.04), 0 3px 6px rgba(0,0,0,0.0575); transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1); display: flex; flex-direction: column; /* 移除 height: 100%,改为默认 auto,让卡片高度随内容自适应 */ /* height: 100%; 删掉这行 */ } .home-card:hover { transform: translateY(-5px); border-color: #3498db; box-shadow: 0 10px 20px rgba(0,0,0,0.1); } /* ====================== 卡片内容区域样式(核心修改) ====================== */ .home-card__header { margin: 0; padding: 15px 20px; background: #e9ecef; border-bottom: 1px solid #dee2e6; font-size: 1.2rem; font-weight: bold; } .home-card .transport-card { position: relative; height: 180px; /* 图片高度可固定,不影响正文自适应 */ margin: 0; border: none !important; } .home-card .transport-image { position: absolute; inset: 0; margin: 0; border-radius: 0; overflow: hidden; } .home-card .transport-image img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s cubic-bezier(0, 0.8, 0.2, 1); } .home-card .transport-image img:hover { transform: scale(1.1); } /* 文本内容区域:解除高度限制 */ .home-card__text { margin: 0; padding: 15px 20px; line-height: 1.6; flex-grow: 1; /* 保留flex特性,让文本区域填充剩余空间(但不限制最大高度) */ /* 删掉以下两行限制,让文本高度随内容自然扩展 */ /* max-height: 76.8px; */ /* overflow: hidden; */ position: relative; } /* 移除文本区域的渐变遮罩(因为内容不再被隐藏) */ .home-card__text::after { display: none; /* 删掉渐变遮罩,避免无意义的覆盖 */ } .home-link { margin: 0 20px 15px; text-align: center; } .home-link__button { display: inline-block; padding: 8px 16px; background: #3498db; color: white; border-radius: 8px; text-decoration: none; transition: background 0.3s ease; font-weight: 600; } .home-link__button:hover { background: #2980b9; }
返回
模板:卡片/Cards.css
。