本WIKI编辑权限开放,欢迎收藏起来防止迷路,也希望有爱的小伙伴和我们一起编辑哟~
融合版WIKI反馈群:556757324
本WIKI编辑权限开放,欢迎收藏起来防止迷路,也希望有爱的小伙伴和我们一起编辑哟~
融合版WIKI反馈群:556757324
模板:图文卡片/文档
<!DOCTYPE html> <html lang="zh-CN"> <head>
<meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>B站Wiki图文卡片模板</title> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0/css/all.min.css">
</head> <body>
<header>
B站Wiki图文卡片模板
此模板允许您创建美观的图文展示卡片,每张卡片包含文字内容和背景图片。模板采用响应式设计,适用于各种设备,并带有优雅的悬停动画效果。
</header>
模板使用指南
创建模板
在B站Wiki中创建一个名为 Template:ImageCard 的模板页面,内容如下:
<div class="text-box" style="background-image: url('{{{image}}}');">
<div class="content"> <div class="card-title">{{{title}}}</div> <div class="card-text">{{{text}}}</div> <div class="card-footer"> <span>作者:{{{author}}}</span> <span class="card-tag">{{{tag}}}</span> </div> </div>
</div>
添加CSS样式
在您的Wiki页面中添加以下CSS样式(可放在页面顶部):
<style> .wiki-container {
display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 25px; margin-top: 20px;
}
.text-box {
position: relative; border-radius: 12px; overflow: hidden; box-shadow: 0 10px 30px rgba(0,0,0,0.25); height: 280px; background-position: center; background-size: cover; transition: all 0.4s ease; display: flex; flex-direction: column; justify-content: flex-end;
}
.text-box:hover {
transform: translateY(-10px); box-shadow: 0 15px 35px rgba(0,0,0,0.4);
}
.content {
position: relative; padding: 20px; background: linear-gradient(to top, rgba(0,0,0,0.85), transparent); color: white; z-index: 2; transition: all 0.3s ease;
}
.text-box:hover .content {
background: linear-gradient(to top, rgba(0,0,0,0.95), transparent);
}
.card-title {
font-size: 1.4rem; font-weight: 700; margin-bottom: 10px; color: #fff;
}
.card-text {
font-size: 1rem; line-height: 1.6; opacity: 0.9; max-height: 80px; overflow: hidden; transition: max-height 0.4s ease;
}
.text-box:hover .card-text {
max-height: 200px;
}
.card-footer {
display: flex; justify-content: space-between; margin-top: 12px; font-size: 0.85rem; opacity: 0.7;
}
.card-tag {
background: rgba(0,161,214,0.7); color: white; padding: 3px 10px; border-radius: 20px; font-size: 0.8rem;
}
@media (max-width: 768px) {
.wiki-container { grid-template-columns: 1fr; }
} </style>
使用模板
在您的Wiki页面中添加以下结构,并按需调用模板:
<div class="wiki-container"> {{ImageCard | image = https://example.com/image1.jpg | title = 卡片标题 | text = 这里是卡片内容,约30-60字 | author = 作者名称 | tag = 分类标签 }} {{ImageCard | image = https://example.com/image2.jpg | title = 另一个标题 | text = 这里是另一段卡片内容 | author = 其他作者 | tag = 其他标签 }} <!-- 添加更多卡片 --> </div>
模板参数说明
卡片的背景图片URL(建议使用800px以上宽度的图片)
卡片的标题(建议不超过15字)
卡片的主要内容(建议30-60字)
内容作者(可选)
分类标签(可选)
<footer>
B站Wiki图文卡片模板 | 设计:DeepSeek-R1 | 本模板响应式设计,兼容移动设备
悬停卡片可查看完整内容 | 每个卡片高度固定,宽度自适应
</footer>
</body> </html>