Wikipedia:Image markup with HTML: Difference between revisions
Content deleted Content added
MartinHarper (talk | contribs) |
Change and format hatnote |
||
(38 intermediate revisions by 32 users not shown) | |||
Line 1:
{{historical}}
''See also [[Wikipedia:Image use policy#Markup]]''▼
{{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]].}}
----------
<div
==
<code><nowiki><div
<code><nowiki>
<br clear="all">
Line 20 ⟶ 19:
--------------
==
----
Line 28 ⟶ 27:
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):
▲<td>left float, no caption</td>
|-
▲<td><code><nowiki><div style="float:left;margin:0 1em 1em 0;">[[Image:NAME|Alt text]]</div></nowiki></code></td>
|-
▲<td>right float, no caption</td>
▲<td><code><nowiki><div style="float:right;margin:0 0 1em 1em;">[[Image:NAME|Alt text]]</div></nowiki></code></td>
|-
|-
▲<td>right float, with caption</td>
|-
|-
▲<td>left float, with larger</td>
▲<td><code><nowiki><div style="float:left;margin:0 1em 1em 0;text-align:center;">[[Image:SMALL|Alt text]]<br>[[Media:LARGE|larger version]]</div></nowiki></code></td>
▲
|}
▲<td>right float, with larger</td>
▲<td><code><nowiki><div style="float:right;margin:0 0 1em 1em;text-align:center;">[[Image:SMALL|Alt text]]<br>[[Media:LARGE|larger version]]</div></nowiki></code></td>
▲<td>large central picture</td>
▲<td><code><nowiki><center>[[Image:NAME|Alt text]]<br>''Caption''</center></nowiki></code></td>
If your caption is longer than a few words, you may need to explicitly set the <code>div</code> width. Some browsers adjust the width of the <code>div</code> based on the width of the text, and if there is a large caption, the <code>div</code> may become too large. To solve this problem, simply set the width of the <code>div</code> to the width (in pixels) of the image, like so:
:<code><nowiki>
(replacing <code>width: 250px;</code> 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 <code>text-align:left;</code> to make it left-justified.
Line 71 ⟶ 62:
Some recommend using <small> for captions, so they appear <small>like this</small>.
== 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: <nowiki>[[:image:STS-32 crew.jpg|STS-32 crew]]</nowiki> which yields: [[:image:STS-32 crew.jpg|STS-32 crew]]
==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.
==See also==
*[[Wikipedia:Picture tutorial|Picture tutorial]]
*[[Wikipedia:Finding images tutorial]]
[[es:Wikipedia:Cómo se añaden imágenes]]
[[sv:Wikipedia:Bildmallar]]
|