Wikipedia:Span tags

In Wikipedia, HTML <span>...</span> elements are used to group logically related text. They 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; this is generally done through the {{Lang}} templates, not with manual span markup)
  • Explicitly setting the direction of the text (LTR or RTL).
  • Avoidance of other HTML tags, such as <s> and the now-deprecated <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).
  • Setting anchors in the text to which incoming links may jump; this is usually done with the {{Anchor}} template.

Almost all HTML tags that are allowed in Wikipedia permit inline CSS styles.