Permitted HTML Tags

From Myth-Wiki
Revision as of 08:34, 20 November 2009 by Plugsy (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Contents

Permitted HTML

The following HTML elements are currently permitted:

  • <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>
  • <small>
  • <strike>
  • <strong>
  • <sub>
  • <sup>
  • <table>
  • <td>
  • <th>
  • <tr>
  • <tt>
  • <u>
  • <ul>
  • <var>
  • <!-- ... -->



Span

<span>, a generic inline text container, is now allowed on default MediaWiki installations (as of version 1.5). Span can be ID'd, classed, or styled:

This is <span style="color:red">red</span> text.

This is <span id="randomfooid">identified</span> text.

This is <span class="importantmessage">classed</span> text.

produces:

This is red text. This is identified text. This is classed text.

IDs and classes are used in conjunction with stylesheets to give a piece of text a descriptive class (or unique identifier) and to refer to that in a stylesheet.

Note that in most cases, one can use a more descriptive tag, for instance, <strong> (which can be classed, identified, and styled, as well) to indicate an important piece of text, or <em> (subject to the same things as strong) to indicate an emphasized piece of text. For instance, the above might be better reformulated as

This is <em style="color:red;font-style:normal">red</em> text.
This is red text.

This not only draws the user's attention to the text, but can also alert those who are using nonvisual browsers or have sight impairments, etc. to the fact that that is emphasized text.



Font

Note: This element is deprecated (should not be used) in favor of <span>.

For some attributes, like color, one can also use

a <font color="red">red</font> word.

giving a red word

It's pontless to combine the legacy tag <font> with inline CSS, legacy browsers would ignore the CSS, while modern browsers support <span> (see above).



Div

E.g. to assign the class "red" to a text one can put

<div class="red">example text</div>
which gives
example text
which is in red if the css line
.red {color:red}

is applicable.

This is suitable if the color is specifically intended to be red; if it is just for emphasis a more general term for the class would be more appropriate, because css allows the user to choose another method of emphasis (another color, bold, enlarged, etc.).

Note that many readers will not have their own css with such lines as ".red {color:red}", so one cannot refer to "the red text above", etc.


External links

elements
attributes