Template:Info:修订间差异
模板页面
更多操作
小 |
|||
| (未显示3个用户的13个中间版本) | |||
| 第1行: | 第1行: | ||
<div class=" | <templatestyles src="Template:Info/styles.css"/> | ||
<div class="info-stack-container {{{class|}}}" style="max-width:{{{width|}}}; border-left-color:{{{color|var(--color-primary, #36c)}}}; background-color:{{{backgroundColor|var(--color-surface-0, #fff)}}}; border-color:{{{borderColor|var(--color-surface-border, #a2a9b1)}}}; {{{style|}}}">{{#if:{{{title|{{{标题|}}}}}}|<div class="info-stack-header" style="padding: {{{titlePadding|8px 12px}}}; text-align: {{{titleAlign|left}}}; font-weight: {{{titleFontWeight|700}}}; font-size: {{{titleFontSize|0.85em}}}; background-color: {{{titleBackgroundColor|var(--color-surface-2, #f0f0f0)}}}; color: {{{titleColor|var(--color-base, #202122)}}}; border-bottom: 1px solid {{{borderColor|var(--color-surface-border, #a2a9b1)}}};">{{{title|{{{标题}}}}}}</div>}}<div class="info-stack-body" style="padding: {{{contentPadding|12px 16px}}}; line-height: {{{contentLineHeight|1.6}}}; color: {{{contentColor|var(--color-base, #202122)}}}; background-color: {{{contentBackgroundColor|transparent}}}; font-size: {{{contentFontSize|0.95em}}};"><div class="info-stack-icon">{{#if:{{{leftimage|{{{图片|}}}}}}|{{{leftimage|{{{图片}}}}}}|[[File:Icon-info.png|{{#if:{{{smallimage|}}}|25px|40px}}]]}}</div><div class="info-stack-content">{{{text|{{{content|{{{1|{{{内容|'''提示内容'''}}}}}}}}}}}}</div></div></div><noinclude>{{Documentation}}[[分类:元模板]]</noinclude> | |||
<includeonly>[[分类:使用了Info模板的页面]]</includeonly> | |||
</div> | |||
<noinclude>{{Documentation}}[[分类:元模板]]</noinclude> | |||
2026年5月25日 (一) 08:15的最新版本
提示内容
效果预览
以下为默认提示框效果(未填任何参数):
提示内容
简洁正文示例:
这是正文内容
带标题示例:
注意
本条目内容可能随时间变化
---
类型与颜色预览
| 类型 | 调用示例 | 实际效果 |
|---|---|---|
| 信息 (info) | {{info|text=这是信息提示}} |
这是信息提示 |
| 警告 (warn) | {{info|text=这是警告提示|color=#f0ad4e|backgroundColor=#fff8e5}} |
这是警告提示 |
| 错误 (error) | {{info|text=这是错误提示|color=#d9534f|backgroundColor=#f8d7da}} |
这是错误提示 |
| 成功 (success) | {{info|text=这是成功提示|color=#5cb85c|backgroundColor=#d4edda}} |
这是成功提示 |
---
简要说明
- 参数
text为必填,其它参数均为选填。 - 参数
1可直接代替text。 - 使用
title可增加标题,使用below可增加脚注或底部说明。 - 使用
type可以控制模板分类:
**top(默认):页顶提示模板 **middle:页中提示模板 **none:无分类
---
完整参数示例
{{info
|width=
|color=
|backgroundColor=
|leftimage=
|icon-style=
|smallimage=
|title=
|title-style=
|text=
|text-style=
|below=
|below-style=
|class=
|type=
}}
参数解析
|width = 模板宽度,默认为 100%
|color = 左侧竖条颜色,默认 #36c
|backgroundColor = 背景颜色,默认 #f8f9fa
|leftimage = 左侧图标,默认 [[File:Icon-info.png|40px|link=]],会覆盖 smallimage 参数
|icon-style = 图标样式,可使用行内 CSS
|smallimage = 图标大小控制,非空时图标为 25px,否则 40px
|title = 标题内容
|title-style = 标题样式(行内 CSS,例如 color:red; font-style:italic;)
|text = 正文内容,可等效使用 content 或 1 参数
|text-style = 正文样式,可等效使用 content-style
|below = 底部内容
|below-style = 底部样式
|class = 模板额外 class
|type = 模板类型,仅供模板页使用:
top(默认)= 页顶提示模板
middle = 页中提示模板
none = 无分类
使用示例
{{info|text=这是正文内容}}
{{info
|title=注意
|text=本条目内容可能随时间变化
|below=底部提示
|color=#f0ad4e
|backgroundColor=#fff8e5
}}
{{info|1=简洁正文内容示例}}