Template:Mbox

Permanently protected template
维基教科书,自由的教学读本


文档图示 模板文档[查看] [编辑] [历史] [清除缓存]

使用方法

This is the {{mbox}} or message box meta-template.

It is used to build message box templates, using CSS classes to reskin it for specific namespaces. It offers several different colours, uses default images if no image parameter is given and it has some other features.

使用方法

{{mbox
| type      = query (optional)
| image     = Emblem-question-yellow.svg (optional)
| style     = width:400px; color:red; font-weight:bold; font-style:italic; (optional)
| text      = The message body text.
}}


消息框类型


Image message box types

In the Image namespace, several additional options are available. It is recommended you still use {{imbox}} for these boxes in the meantime, as imbox uses different markup in line with other Ambox implementations and the image margins used on mbox are different.

其他图片

The default images shown above are mostly for convenience. In many cases it is more appropriate to use more specific images. These examples use the image parameter to specify an image other than the default images.

Special

Some other parameter combinations.


Technical details

This template uses CSS classes.

If you need to use special characters in the text parameter then you need to escape them like this:

{{mbox
| text  = <div>
Equal sign = and a start and end brace { } work fine as they are. 
But here is a pipe {{!}} and two end braces <nowiki>}}</nowiki>. 
And now a pipe and end braces <nowiki>|}}</nowiki>.
</div>
}}


Internally this meta-template uses HTML markup instead of wiki markup for the table code. That is the usual way we make meta-templates since wiki markup has several drawbacks. For instance it makes it harder to use parser functions and special characters in parameters.