HTML (HyperText Markup Language) is a language used on websites to format the layout and content. Wiki pages are generally managed by wikitext rather than HTML, so only a limited number of HTML tags can be used on articles.
HTML (and wikitext) can be written and managed while using the editor's source editor.
HTML tags in wikitext[]
Supported tags[]
The following HTML tags can be used in articles:
<abbr><b>[1]<bdi><bdo><blockquote><br /><caption><cite><code><data><dd>[1]<del><dfn><div><dl>[1]<dt>[1]<em>[1]<h1>[1]<h2>[1]<h3>[1]<h4>[1]<h5>[1]<h6>[1]<hr>[1]<i>[1]<ins><kbd><li>[1]<mark><ol>[1]<p>[1]<pre>[2]<q><rp><rt><ruby><s><samp><small><span><strong><sub><sup><table>[1]<td>[1]<th>[1]<time><tr>[1]<u><ul>[1]<var><wbr /><!-- -->
- ↑ 1.00 1.01 1.02 1.03 1.04 1.05 1.06 1.07 1.08 1.09 1.10 1.11 1.12 1.13 1.14 1.15 1.16 1.17 1.18 1.19 1.20 These tags have equivalent wikitext markup, which is generally preferable. See #Usage notes.
- ↑ <pre> is actually a parser tag. It applies the HTML tag but also escapes any markup inside except HTML entities, similar to <nowiki>
Deprecated tags[]
Deprecated HTML tags will still work, but they may not in future software versions or browsers.
| Deprecated tag | Replacement | Example | Example display |
|---|---|---|---|
<big>
|
<span style="font-size: larger;">
|
<span style="font-size: larger;">big</span>
|
big |
<center>
|
<div style="text-align: center;">
|
<div style="text-align: center;">Centered</div>
|
Centered
|
<font color="x" size="y" face="z">
|
<span style="color: x; font-size: y; font-family: z;">
|
<span style="color: red;">Red Alert!</span>
|
Red Alert! |
<span style="font-family: Times New Roman;">This is Times New Roman</span>
|
This is Times New Roman | ||
<strike>
|
del (for marking an edit)
|
<del>Yes</del> No
|
|
<s> (for anything else)
|
Photon Torpedoes <s>$44.99</s> '''now just $24.99!''' each
|
Photon Torpedoes | |
<tt>
|
<code> (preferred for source code)
|
use <code> </code> for nonbreaking space
|
use for nonbreaking space
|
<kbd> (preferred for user input)
|
<kbd>mypasswd</kbd>
|
mypasswd | |
<var> (preferred for variables)
|
<var>age</var>=65
|
age=65 | |
<samp> (preferred for computer output)
|
<samp>Invalid password. Please try again.</samp>
|
Invalid password. Please try again. | |
| Similar appearance without special meaning | <span style="font-family: monospace;">Typed text</span>
|
Typed text | |
Table cell horizontal alignment: align=Xwhere X is "left", "center" or "right" (sometimes without quotes) |
style="text-align: X;"
|
style="text-align: right;" | right-justified text
|
right-justified text |
Table cell vertical alignment: valign=Xwhere X is "top", "middle" or "bottom" (sometimes without quotes) |
style="vertical-align: X;"
|
style="vertical-align: top;" | top aligned text
|
top aligned text |
Table cell background color: bgcolor=X
|
style="background-color: X;"
|
style="background-color: pink" | pink background
|
pink background |
Inserting symbols[]
Symbols and other special characters not available on your keyboard can be inserted through a special sequence of characters. Those sequences are called HTML entities. For example, the following sequence (entity) → when inserted will be shown as right arrow HTML symbol → and — when inserted will be shown as an em dash HTML symbol —.
Hover over any character to find out the symbol that it produces. Some symbols not available in the current font will appear as empty squares.
| HTML symbol entities | |||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Á | á | Â | â | ´ | Æ | æ | À | à | ℵ | Α | α | & | ∧ | ∠ | Å | å | ≈ | Ã | ã | Ä | ä | „ | Β | β | ¦ | • | ∩ | Ç | ç | ¸ | ¢ |
| Χ | χ | ˆ | ♣ | ≅ | © | ↵ | ∪ | ¤ | † | ‡ | ↓ | ⇓ | ° | Δ | δ | ♦ | ÷ | É | é | Ê | ê | È | è | ∅ | Ε | ε | ≡ | Η | η | ||
| Ð | ð | Ë | ë | € | ∃ | ƒ | ∀ | ½ | ¼ | ¾ | ⁄ | Γ | γ | ≥ | > | ↔ | ⇔ | ♥ | … | Í | í | Î | î | ¡ | Ì | ì | ℑ | ∞ | ∫ | Ι | ι |
| ¿ | ∈ | Ï | ï | Κ | κ | Λ | λ | ⟨ | « | ← | ⇐ | ⌈ | “ | ≤ | ⌊ | ∗ | ◊ | | ‹ | ‘ | < | ¯ | — | µ | · | − | Μ | μ | ∇ | – | |
| ≠ | ∋ | ¬ | ∉ | ⊄ | Ñ | ñ | Ν | ν | Ó | ó | Ô | ô | Œ | œ | Ò | ò | ‾ | Ω | ω | Ο | ο | ⊕ | ∨ | ª | º | Ø | ø | Õ | õ | ⊗ | Ö |
| ö | ¶ | ∂ | ‰ | ⊥ | Φ | φ | Π | π | ϖ | ± | £ | ′ | ″ | ∏ | ∝ | Ψ | ψ | " | √ | ⟩ | » | → | ⇒ | ⌉ | ” | ℜ | ® | ⌋ | Ρ | ρ | |
| › | ’ | ‚ | Š | š | ⋅ | § | | Σ | σ | ς | ∼ | ♠ | ⊂ | ⊆ | ∑ | ⊃ | ¹ | ² | ³ | ⊇ | ß | Τ | τ | ∴ | Θ | θ | ϑ | Þ | þ | ˜ | |
| × | ™ | Ú | ú | ↑ | ⇑ | Û | û | Ù | ù | ¨ | ϒ | Υ | υ | Ü | ü | ℘ | Ξ | ξ | Ý | ý | ¥ | ÿ | Ÿ | Ζ | ζ | | | ||||
| Description | You type | You get |
|---|---|---|
| Copyright symbol | ©
|
© |
| Greek delta letter symbol | δ
|
δ |
| Euro currency symbol | €
|
€ |
See the list of all HTML entities on the Wikipedia article List of HTML entities.
Additionally, MediaWiki supports two non-standard entity reference sequences: &רלמ; and &رلم; which are both considered equivalent to ‏ which is a right-to-left mark. (Used when combining right to left languages with left to right languages in the same page.)
Displaying raw HTML tags and entities[]
To display the raw HTML code, you can do this in two ways:
- by replacing selected characters (&, <, etc.) with HTML entities:
&euro;→ €<span style="color: red; text-decoration: line-through;"> Typo to be corrected</span>→ Typo to be corrected<span style="color: red; text-decoration: line-through;">Typo to be corrected</span>→ <span style="color: red; text-decoration: line-through;">Typo to be corrected</span>
- by using the <nowiki /> tag:
<<nowiki />pre>→ <pre>
Using the <nowiki /> tag does not work for HTML entities.
To display an entity as plain text, replace the ampersand with &.
&<nowiki />amp;→ &&nbsp;→
Usage notes[]
- Keep it friendly
- The use of wikitext is recommended wherever possible, as HTML generally makes the text in the edit box harder to read and more intimidating for new users. Complex uses of HTML and CSS can be hidden away in templates, where they are less likely to get in the way of the casual editor.
- Combine it with CSS
- Styling information can be stored in community CSS pages (using code like
class="classname"). Both CSS classes and inline styling (style="color: pink;") can be used with the HTML tags listed above, and they can also be used with many types of wikitext, particularly tables, table rows and cells. However, please keep in mind that use of inline styling should be limited, as it can cause conflicts with the mobile experience of your community.
See also[]
- Help:CSS and JS customization
- Help:Tables
- Help:Editing
- MediaWiki's help page
- Using HTML in wikitext on MediaWiki
- Information on using span tags on Wikipedia
Further help and feedback[]
- Browse and search other help pages at Help:Contents
- Check Fandom Community Central for sources of further help and support
- Check Contacting Fandom for how to report any errors or unclear steps in this article