Help:Gallery: Difference between revisions

From the Super Mario Wiki, the Mario encyclopedia
Jump to navigationJump to search
mNo edit summary
mNo edit summary
Line 35: Line 35:
This can be accomplished using the <code>widths</code>, <code>heights</code>, and <code>class</code> parameters, respectively.
This can be accomplished using the <code>widths</code>, <code>heights</code>, and <code>class</code> parameters, respectively.


The following background color classes are available: <code>blackbg</code>, <code>graybg</code>
=== Supported classes ===
 
* <code>rawsize</code> : Prevent the image from being upscaled
The <code>noresize</code> class can be used to prevent image upscaling.
** <code>rawsize x2</code> - <code>rawsize x4</code> : Scale a specific amount
* <code>blackbg</code> / <code>graybg</code> : Change the background color of the image container
* <code>invert-light</code> / <code>invert-dark</code> : Invert the image in the wiki's light or dark mode


=== Example ===
=== Example ===
<gallery class="blackbg noresize" widths="50" heights="50">
<gallery class="blackbg rawsize x3" widths="50" heights="50">
SM64 Asset Sprite CS Mario.png|Mario
SM64 Asset Sprite CS Mario.png|Mario
SM64 Asset Sprite CS Coin.png|Yellow Coin
SM64 Asset Sprite CS Coin.png|Yellow Coin
Line 48: Line 50:
==== Source code ====
==== Source code ====
<pre>
<pre>
<gallery class="blackbg noresize" widths="50" heights="50">
<gallery class="blackbg rawsize x3" widths="50" heights="50">
SM64 Asset Sprite CS Mario.png|Mario
SM64 Asset Sprite CS Mario.png|Mario
SM64 Asset Sprite CS Coin.png|Yellow Coin
SM64 Asset Sprite CS Coin.png|Yellow Coin

Revision as of 16:03, July 14, 2024

This help page covers how to create an image gallery.

Gallery basics

Galleries are best used in situations where many images need to be displayed. Galleries are like thumbnails boxed together in a table.

By default, galleries have a fluid width. Do not create galleries with a fixed width on any page outside of your userspace.

The basic syntax for a gallery is as follows:

<gallery>
Image name.ext|Caption
</gallery>

Example

Source code

<gallery>
MarioMP8Artwork.png|[[Mario]]
Luigi Artwork - Mario Party 7.png|[[Luigi]]
NSMBDS Bowser Artwork.png|[[Bowser]]
</gallery>

Advanced options

In rare instances, it may be necessary to change the image widths, heights, and even background color in order to display them properly in a gallery.

This can be accomplished using the widths, heights, and class parameters, respectively.

Supported classes

  • rawsize : Prevent the image from being upscaled
    • rawsize x2 - rawsize x4 : Scale a specific amount
  • blackbg / graybg : Change the background color of the image container
  • invert-light / invert-dark : Invert the image in the wiki's light or dark mode

Example

Source code

<gallery class="blackbg rawsize x3" widths="50" heights="50">
SM64 Asset Sprite CS Mario.png|Mario
SM64 Asset Sprite CS Coin.png|Yellow Coin
SM64 Asset Sprite CS Power Star.png|Power Star
</gallery>

The above method applies a class to all images in the gallery. For details on how to apply classes on a per-image basis, see Template:Class.

Galleries in articles

See MarioWiki:Galleries for details on how article gallery sections and dedicated gallery pages should be laid out.