Template:Gallery/doc

From DoveArchives
Jump to navigation Jump to search

Blank syntax

{{Gallery
| title        = 
| align        =
| footer       =
| style        =
| state        =
| height       =
| width        =
| captionstyle =
| File:
 | alt1=
 | Write a caption here
| File:
 | alt2=
 | Write a caption here
| File:
 | alt3=
 | Write a caption here
| File:
 | alt4=
 | Write a caption here
| File:
 | alt5=
 | Write a caption here
}}

Parameters

For each image

Specify a line of the following form for each image.

|File:Filename |altn=Alt text |Caption

Where:

|File:Filename – the image's file name. Either File: or Image: prefix may be used
|Altn=alt attribute: |alt1= for the first image, |alt2= for the second image, etc
Alt text – the alternative text for the image, used by visually impaired or other readers who cannot see the image clearly. If omitted, the image's alt text will be blank.
|Caption – the caption under the image; see Wikipedia:Manual of Style/Captions

Optional parameters

These parameters apply to the gallery:

|title= – The gallery's title
|align= – The alignment of the gallery on the page, left (default), center, or right; ignored when |state= is set
|footer= – Small, right-aligned text below the images
|style=CSS style directives for the whole gallery (see Help:Cascading Style Sheets)
|state= – Sets the default state of collapsible galleries; use |state=expanded or |state=collapsed; collapsible galleries occupy the full page width
|mode= – Sets the mode used by the inner gallery tag. Common values include |mode=packed and |mode=nolines (see Help:Gallery tag for more options)

These parameters apply to all of the images in the gallery:

|noborder= – Cancel the border surrounding the images, use |noborder=yes to set.
|whitebg= – Cancel the white background after the images, use |whitebg=no to set.
|height= – Maximum height of each image. If this parameter is not included, |height= defaults to 180 pixels. Use a simple number here, e.g., 200, without a units designation, e.g., 200px.
|width= – Maximum width of each image, default is 180 pixels. Use a number here, e.g., 150, without units, e.g., 150px.
|captionstyle=CSS style directives for the captions (see Help:Cascading Style Sheets)

The image's original ratio of width to height cannot be modified by |width= or |height= – a rectangular image will not be made square if |width= and |height= are set to the same value.