| advertise add site services publishers database health videos | ![]() | about toolbar stats live show health store more stuff JOIN/LOGIN |
Spinning class in Santa Monica | Los Angeles spinning class smpersonaltraining.com | Health Classes, Herbal Classes, Detoxification in NJ drbump.com | CPR Classes in Phoenix Arizona | CPR Training Classes personalpowertraining.net |
This how-to guide describes how to use the ambox CSS classes to create article message boxes such as {{wikify}} etc. The ambox CSS classes are defined in MediaWiki:Common.css. This guide describes how to use the classes directly in wikitables and HTML tables. There is also a meta template {{ambox}} that makes it easy to create article message boxes. It has usage documentation and examples and can handle the most common usage cases. But {{ambox}} is mostly a thin wrapper for the CSS classes. If/when you need more advanced functionality you can use the classes directly in a wikitable or HTML table as described in this guide.
[edit] Other mboxesThe CSS classes for the {{tmbox}}, {{imbox}}, {{cmbox}} and {{ombox}} also work as described in this guide. Just change the naming from " [edit] Browser cacheIf these boxes don't look alike, you may need to refresh your web browser cache:
This happens when the CSS classes have been updated but still is cached in your browser. This usually is gone in some days. [edit] Basic usageSimple usage example with the default blue "notice" colour: {| class="ambox" |- | class="mbox-image" | Image | class="mbox-text" | Some text. |}
Slightly more complex example with the purple "move/merge/split/transwiki proposals" colour and an image: {| class="ambox ambox-move" |- | class="mbox-image" | [[Image:Edit-copy purple.svg|40px]] | class="mbox-text" | Some text. |}
[edit] Ambox CSS classesAll the styles for the article message boxes are defined as CSS classes in MediaWiki:Common.css. This allows the message boxes to be skinned. That is, they can be overridden in the style sheets for different Wikipedia skins and also in your own monobook.css. Here are the ambox class names and what they define.
[edit] More usage {| class="ambox ambox-notice" | class="mbox-image" | [[Image:Gnome globe current event.svg|42px]] | class="mbox-text" | <div> '''This article or section documents a current [[spaceflight]].''' <br>Content may change as the mission progresses. </div> | class="mbox-imageright" | [[Image:Shuttle.svg|20px]] |}
In the example above:
MediaWiki has some oddities when handling content in tables. Thus here we also applied a pair of We also applied a [edit] HTML tablesMediaWiki also understands HTML markup. Note that this is not really HTML markup but really "HTML wikimarkup", since MediaWiki processes it just like wikimarkup. Here is the example from above, but now with HTML markup: <table class="ambox ambox-notice"> <tr> <td class="mbox-image"> [[Image:Gnome globe current event.svg|42px]] <td class="mbox-text"><div> '''This article or section documents a current [[spaceflight]].''' <br>Content may change as the mission progresses. </div> <td class="mbox-imageright"> [[Image:Shuttle.svg|20px]] </table>
The example above doesn't use end
[edit] Box width and box flowThe mbox classes and the mbox meta-templates such as {{ambox}} and {{tmbox}} are designed in such a way that they work smoothly in all web browsers. Here are some of the things that they take care of:
These things are what we call proper "box flow". [edit] No image cellFor an mbox to get 80% wide and proper box flow it has to have at least one "mbox-text" cell and one other cell of at least 1px width on the same table row. That other cell usually is an "mbox-image" cell, but if you don't have an image cell then you can simply add an empty cell:
However, empty cells default to at least 3px width (width+padding), which sometimes can be fairly visible. So for convenience there is the mbox-empty-cell class which sets the cell to just 1px width, and no border or padding:
The empty cell can be either to the left or to the right of the text cell, both works. [edit] See also
|
| ↑ top of page ↑ | about thumbshots |