Jump to content

Template:Mbox: Difference between revisions

From The Hall of Mirrors
Created page with "<table class="msgbox {{#if: {{{classes|}}}|{{{classes}}}|}}" style="{{#if: {{{border|}}}|border-color: {{{border}}};|}} {{#if: {{{background|}}}|background: {{{background}}};|}} {{#if: {{{color|}}}|color: {{{color}}};|}}"> <tr> <td class="msgboximg" style="min-width:{{{min-width|50}}}px;"> {{#if: {{{image|}}}| [[File:{{{image}}}|{{{iwidth|50}}}px|{{{pic-align|center}}}|{{{caption|}}}]] }} </td> <td>{{{text|}}}</td> </tr> </table> {{Mbox | text = This is some awesome tex..."
 
No edit summary
 
(One intermediate revision by the same user not shown)
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>
<td class="msgboximg" style="min-width:{{{min-width|50}}}px;">
{{#if: {{{image|}}}|
{{#if: {{{image|}}}|
<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 style="padding:4px;">{{{text|}}}</td>
<td>{{{text|}}}</td>
</tr>
</tr>
</table>
</table>
 
<noinclude>
{{Mbox
{{Mbox
| text = This is some awesome text!
| text = This is some awesome text!
| image = Example.png
| iwidth = 50
| iwidth = 50
| caption = W image caption
| border = #ddd
| border = #ddd
| background = #fff
| background = #000
| color = #000
| color = #fff
| min-width = 50
| min-width = 50
| pic-align = center
| pic-align = center
}}
}}
<noinclude>
== Usage ==
== Usage ==


Line 34: Line 30:
| caption = Image caption
| caption = Image caption
| border = #ddd
| border = #ddd
| background = #fff
| background = #000
| color = #000
| color = #fff
| min-width = 50
| min-width = 50
| pic-align = center
| pic-align = center
Line 53: Line 49:
* '''min-width''' — Minimum width of the image cell. Defaults to 50px.
* '''min-width''' — Minimum width of the image cell. Defaults to 50px.
* '''pic-align''' — Image alignment. Defaults to center.
* '''pic-align''' — Image alignment. Defaults to center.
* '''classes''' — Optional CSS classes.
* '''classes''' — Optional CSS classes.i wa


[[Category:Layout templates]]
[[Category:Layout templates]]
</noinclude>
</noinclude>

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