Template:Info/doc:修订间差异
模板页面
更多操作
OctoberSama(留言 | 贡献) (创建页面,内容为“== 效果预览 == 不填写任何参数时,效果如下。 {{info}} == 简要说明 == * 参数<code>text</code>为必填,其他参数均为选填。 ** 也可以直接使用参数<code>1</code>。例如<code><nowiki>{{Info|内容}}</nowiki></code>和<code><nowiki>{{Info|text=内容}}</nowiki></code>是等价的。 * 可以使用参数title来增加一个标题,也可以用参数below增加一个脚注。 * 在使用该模板制作其他模板时,可…”) |
小 |
||
| 第1行: | 第1行: | ||
== 效果预览 == | == 效果预览 == | ||
以下为默认提示框效果(未填任何参数): | |||
{{info}} | {{info}} | ||
简洁正文示例: | |||
<nowiki>{{info|这是正文内容}}</nowiki> | |||
带标题示例: | |||
<nowiki>{{info|title=注意|text=本条目内容可能随时间变化}}</nowiki> | |||
--- | |||
== 类型与颜色预览 == | |||
{| class="wikitable" style="width:100%;border-collapse:collapse;text-align:left;" | |||
! 类型 !! 调用示例 !! 实际效果 | |||
|- | |||
| 信息 (info) || <nowiki>{{info|text=这是信息提示}}</nowiki> || {{info|text=这是信息提示}} | |||
|- | |||
| 警告 (warn) || <nowiki>{{info|text=这是警告提示|color=#f0ad4e|backgroundColor=#fff8e5}}</nowiki> || {{info|text=这是警告提示|color=#f0ad4e|backgroundColor=#fff8e5}} | |||
|- | |||
| 错误 (error) || <nowiki>{{info|text=这是错误提示|color=#d9534f|backgroundColor=#f8d7da}}</nowiki> || {{info|text=这是错误提示|color=#d9534f|backgroundColor=#f8d7da}} | |||
|- | |||
| 成功 (success) || <nowiki>{{info|text=这是成功提示|color=#5cb85c|backgroundColor=#d4edda}}</nowiki> || {{info|text=这是成功提示|color=#5cb85c|backgroundColor=#d4edda}} | |||
|} | |||
--- | |||
== 简要说明 == | == 简要说明 == | ||
* 参数<code>text</code> | * 参数 <code>text</code> 为必填,其它参数均为选填。 | ||
* | * 参数 <code>1</code> 可直接代替 <code>text</code>。 | ||
* | * 使用 <code>title</code> 可增加标题,使用 <code>below</code> 可增加脚注或底部说明。 | ||
* | * 使用 <code>type</code> 可以控制模板分类: | ||
== | ** <code>top</code>(默认):页顶提示模板 | ||
** <code>middle</code>:页中提示模板 | |||
** <code>none</code>:无分类 | |||
--- | |||
== 完整参数示例 == | |||
<pre> | <pre> | ||
{{info | {{info | ||
| 第26行: | 第56行: | ||
}} | }} | ||
</pre> | </pre> | ||
== 参数解析 == | == 参数解析 == | ||
<pre> | <pre> | ||
|width = 模板宽度,默认为 100% | |||
|width = | |||
|color = | |color = 左侧竖条颜色,默认 #36c | ||
|backgroundColor = | |backgroundColor = 背景颜色,默认 #f8f9fa | ||
|leftimage = | |leftimage = 左侧图标,默认 [[File:Icon-info.png|40px|link=]],会覆盖 smallimage 参数 | ||
|icon-style = | |icon-style = 图标样式,可使用行内 CSS | ||
|smallimage = | |smallimage = 图标大小控制,非空时图标为 25px,否则 40px | ||
|title = | |title = 标题内容 | ||
|title-style = | |title-style = 标题样式(行内 CSS,例如 color:red; font-style:italic;) | ||
|text = | |text = 正文内容,可等效使用 content 或 1 参数 | ||
|text-style = | |text-style = 正文样式,可等效使用 content-style | ||
|below = | |below = 底部内容 | ||
|below-style = | |below-style = 底部样式 | ||
|class = | |class = 模板额外 class | ||
|type = < | |type = 模板类型,仅供模板页使用: | ||
top(默认)= 页顶提示模板 | |||
middle = 页中提示模板 | |||
none = 无分类 | |||
</pre> | |||
== 使用示例 == | |||
<pre> | |||
{{info|text=这是正文内容}} | |||
{{info | |||
|title=注意 | |||
|text=本条目内容可能随时间变化 | |||
|below=底部提示 | |||
|color=#f0ad4e | |||
|backgroundColor=#fff8e5 | |||
}} | }} | ||
</pre><noinclude>[[Category:模板文档]]</noinclude> | |||
{{info|1=简洁正文内容示例}} | |||
</pre> | |||
<noinclude>[[Category:模板文档]]</noinclude> | |||
2026年2月6日 (五) 02:00的版本
效果预览
以下为默认提示框效果(未填任何参数):
提示内容
简洁正文示例: {{info|这是正文内容}}
带标题示例: {{info|title=注意|text=本条目内容可能随时间变化}}
---
类型与颜色预览
| 类型 | 调用示例 | 实际效果 |
|---|---|---|
| 信息 (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=简洁正文内容示例}}