Jump to content

Template:Mbox: Difference between revisions

From The Hall of Mirrors
No edit summary
No edit summary
 
Line 1: Line 1:
<table class="msgbox {{#if: {{{classes|}}}|{{{classes}}}|}}" style="{{#if: {{{border|}}}|border-color: {{{border}}};|}} {{#if: {{{background|}}}|background: {{{background}}};|}} {{#if: {{{color|}}}|color: {{{color}}};|}}">
<table class="msgbox {{#if: {{{classes|}}}|{{{classes}}}|}}" style="display:inline-table; vertical-align:top; margin:0 2px 4px 0; border-collapse:collapse; {{#if: {{{border|}}}|border:1px solid {{{border}}};|}} {{#if: {{{background|}}}|background:{{{background}}};|}} {{#if: {{{color|}}}|color:{{{color}}};|}}">
<tr>
<tr>
{{#if: {{{image|}}}|
{{#if: {{{image|}}}|
<td class="msgboximg" style="min-width:{{{min-width|50}}}px;">
<td class="msgboximg" style="min-width:{{{min-width|50}}}px; padding:4px;">
[[File:{{{image}}}|{{{iwidth|50}}}px|{{{pic-align|center}}}|{{{caption|}}}]]
[[File:{{{image}}}|{{{iwidth|50}}}px|{{{pic-align|center}}}|{{{caption|}}}]]
</td>
</td>
}}
}}
<td>{{{text|}}}</td>
<td style="padding:4px;">{{{text|}}}</td>
</tr>
</tr>
</table>
</table>

Latest revision as of 17:54, 4 September 2026

This is some awesome text!

Usage

Creates a message box that can be used by other templates.

{{Mbox
| text = Text inside the box
| image = Example.png
| iwidth = 50
| caption = Image caption
| border = #ddd
| background = #000
| color = #fff
| min-width = 50
| pic-align = center
| classes = custom-class
}}

Parameters

  • text — Text displayed inside the box.
  • image — Optional image. Use the file name only.
  • iwidth — Image width. Defaults to 50px.
  • caption — Optional image caption.
  • border — Border color.
  • background — Background color.
  • color — Text color.
  • min-width — Minimum width of the image cell. Defaults to 50px.
  • pic-align — Image alignment. Defaults to center.
  • classes — Optional CSS classes.i wa