Wicipedia:Cystrawen estynedig delwedd

Syntax for images with no automatic caption or formatting

golygu

The old syntax for images is [[Delwedd:Westminstpalace.jpg|caption text]]. This is rendered inline, and the caption text is used as the image's alt attribute (alternate text for programs which cannot display images, such as screen readers) and as the title attribute (supplementary text, often displayed as a tool tip when the mouse is over the image).

See Wikipedia:Image markup for putting a caption text under the image, and Wikipedia:alternate text for images for discussion of appropriate caption text.

Example

golygu

 

New syntax for images without caption text displayed underneath, and for thumbnails

golygu
 
Palas San Steffan

The new syntax is backward compatible, so articles don't have to be changed. Parameters indicating how to render the image can be given, using the syntax [[Delwedd:Westminstpalace.jpg|options|caption text]].

Available options are:

thumbnail, bawd
generates an automatically resized thumbnail image, normally on the right, with the caption text displayed directly underneath. An "enlarge"-icon is added. Example: [[Delwedd:Westminstpalace.jpg|bawd|Palas San Steffan]]
de
make the image right-aligned, can be used with and without specifying thumb
chwith
same as above, but left aligned.
dim
The image will be rendered inline, even if the thumbnail-option is set
maintpx
render a thumbnail version of the image that's [maint] pixels wide (e.g. '150px'). Height is computed to keep aspect ratio (i.e. the shape of the image).


Vertical bars are used to separate options from each other and from the caption text. Unknown options are skipped and the last option is used as the caption text.


 

Example for an image without caption text displayed underneath:

[[Delwedd:Westminstpalace.jpg|de|]]

The last vertical bar ensures that the alternate text becomes "Westminstpalace.jpg" and not "de".


The options can be combined, e.g. as

 
Palas San Steffan
 
Palas San Steffan

[[Delwedd:Westminstpalace.jpg|chwith|80px|Palas San Steffan]] (yn ddangos ar y chwith) neu

[[Delwedd:Westminstpalace.jpg|bawd|80px|Palas San Steffan]] (yn dangos ar y dde).

The option dim can be used to have thumbnails without left- or right-alignment. This is probably most useful for tables. This is an example:

How to use none
London's palaces
Palas San Steffan
 
O'r Tafwys
Palas Buckingham
 
Cartref y brenhines
golygu

The caption text in the new syntax can not have a link; instead, apply the new syntax with an empty caption, and position the image with the real caption like in the old image syntax, e.g.:

<div style="float:right;margin:0 0 1em 1em;font-style:italic;"> [[Delwedd:Westminstpalace.jpg|none|thumbnail|]] [[San Steffan]]</div>


Cancelling floating-around-image mode

golygu

After having had some text next to an image, putting further text below it, using the full width again, is done with <br clear="all">.