Wikipedia:Span tags

From Wikipedia, the free encyclopedia

As of December 23 2004, span tags may be used in MediaWiki. Polls were held in May and August 2004 on whether the English Wikipedia should enable <span> tags. The results were equally split between supporting and opposing the addition of these tags [1]. In December, the earlier objections that this would be a semantically void element were deemed to be no longer applicable since MediaWiki now has a way to add to the global stylesheets in the wiki (at least for the main skins). The addition of <span> to the whitelist was announced following no general objection amongst developers.

Span tags allow:

  • Explicitly setting the CSS style for an inline run of text
  • Explicitly setting the language for a run of text (for cases where the rendering differs from language to language)
  • Explicitly setting the direction of the txt (LTR or RTL).
  • Avoidance of other HTML tags, such as <s> and <strike>, which would otherwise be used as workarounds, but are less suitable.
  • Syntax highlighting; code excerpts can be colorized for easier reading, customizable with CSS.
  • Various uses in infoboxes and navigational templates.
  • Specification of class and id attributes for certain boilerplate messages which should be inlined; e.g. {{merge}}.
  • Citation templates (see above).

[edit] Permitted tags

For reference, all of the following HTML tags are currently permitted on Wikipedia. Almost all these tags permit inline CSS styles.

  • <b>
  • <big>
  • <blockquote>
  • <br>
  • <caption>
  • <center>
  • <cite>
  • <code>
  • <dd>
  • <div>
  • <dl>
  • <dt>
  • <em>
  • <font>
  • <h1>
  • <h2>
  • <h3>
  • <h4>
  • <h5>
  • <h6>
  • <hr>
  • <i>
  • <li>
  • <ol>
  • <p>
  • <pre>
  • <rb>
  • <rp>
  • <rt>
  • <ruby>
  • <s>
  • <span>
  • <small>
  • <strike>
  • <strong>
  • <sub>
  • <sup>
  • <table>
  • <td>
  • <th>
  • <tr>
  • <tt>
  • <u>
  • <ul>
  • <var>
  • <!-- ... -->