Wikipedia:Image markup with HTML
{{historical}}
{{hatnote|Note: this page is deprecated – never format images like this! It is provided purely for historical interest. For a quick guide to adding images, see Help:Pictures. For a comprehensive guide, see Wikipedia:Extended image syntax.}}
----------
Caption
Right-floating image with caption
Column of images, floated
See the [https://en.wikipedia.org/w/index.php?title=Floppy_disk&oldid=2071852 2003 version of Floppy disk] for an example.
----
Markup for images is quite complicated. This may be improved in the future: see meta:image pages. Here are some examples of typical markup ("image" for an image in the page, "media" for just a link):
border="1" cellpadding="2"
|left float, no caption | |
right float, no caption
| |
left float, with caption
| |
right float, with caption
| |
left float, with larger
| |
right float, with larger
| |
large central picture
| |
If your caption is longer than a few words, you may need to explicitly set the div
width. Some browsers adjust the width of the div
based on the width of the text, and if there is a large caption, the div
may become too large. To solve this problem, simply set the width of the div
to the width (in pixels) of the image, like so:
:
Caption
(replacing width: 250px;
with the correct width of your image. The inclusion of this specification is optional, but recommended if you have a caption longer than a few words. For large amounts of caption text, use text-align:left;
to make it left-justified.
Alternate text is optional but recommended. See Alternate text for images for hints on writing good alternate text.
To have some text to the left of an image, and then some more text below the image, then put in a single
Some recommend using <small> for captions, so they appear like this.
Link to the image description page
If you want to make a link to the description page for an image, use a leading colon before "image:" in an intra-wiki link, like this:
Blank line after image code
Always put a blank line after the image code to avoid an ugly indentation of the text with Internet Explorer.