Template:Em/doc

From Unofficial Homecoming Wiki
< Template:Em
Revision as of 02:53, 8 December 2024 by BlackSpectre (talk | contribs) (Created page with "{{Documentation subpage}} __NOTOC__ <!-- PLEASE ADD CATEGORIES AND INTERWIKIS AT THE BOTTOM OF THIS PAGE. --> ==Usage== : <code><nowiki>{{em|text to be emphasized}}</nowiki></code> or, if the text to be emphasized contains an equals sign: : <code><nowiki>{{em|1=text to be emphasized}}</nowiki></code> These both render as: : {{em|1=text to be emphasized}} This template puts intentional and explicit <nowiki><em>...</em></nowiki> (emphasis) [X]HTML markup around the text...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search
This is a documentation subpage for Template:Em (see that page for the template itself).
It contains usage information, categories and other content that is not part of the original template page.


Usage

{{em|text to be emphasized}}

or, if the text to be emphasized contains an equals sign:

{{em|1=text to be emphasized}}

These both render as:

text to be emphasized

This template puts intentional and explicit <em>...</em> (emphasis) [X]HTML markup around the text provided as the first parameter.

Optional parameters

Advanced HTML values can be passed through the template to the HTML code:


  • |style= takes inline CSS input; adds style="CSS directive[s]" to the HTML code
  • |title= takes text, which cannot be marked up in any way, and displays it as a pop-up "tooltip" (in most browsers) when the cursor hovers over the span
  • |id= takes a valid, unique HTML ID (must begin with an alphabetic letter) which you have defined on the page; adds id="name" to the HTML code in order to format that element or create an in-page link.
  • |class= takes a class name (or multiple class names, separated by commas); adds class="classname[s]" to the HTML code


Use cases


This template is made to mildly emphasize an important word or phrase in a passage, in a way that is (unlike simply italicizing it) semantically meaningful markup. With this technique, the emphasized text stands out from the rest of the nearby text in most if not all visual browsers and some text-to-speech screen readers (which usually ignore purely typographic italicization), without strongly affecting scannability. It can also be parsed by user agents and other software as definitively indicating emphasis, not just some typographic boldface effect for appearance's sake. It should therefore only be used sparingly in articles, to highlight something being stressed (e.g., to represent strong vocal emphasis). Example:

  • "Contrary to reports, she was {{em|not}} dead after all."
    "Contrary to reports, she was not dead after all."

Examples

{{em|italicized this text}}

Renders as italicized this text

{{em|style=color:red|turn the color of the text red and italicize}}

Renders as turn the color of the text red and italicize

{{em|title=means to contemplate a question|Wondering}}

Renders as Wondering

{{em|id=myHTMLid|text to format}}

Renders with the format or link you specified applied to the text

{em|class=myHTMLClassName|Text to format}

Renders with the format you specified applied to the text