Template:Em: Difference between revisions
BlackSpectre (talk | contribs) No edit summary |
BlackSpectre (talk | contribs) No edit summary |
||
(One intermediate revision by the same user not shown) | |||
Line 2: | Line 2: | ||
Shortcut template for emphasizing text with italics. | Shortcut template for emphasizing text with italics. | ||
{{documentation}} | |||
</noinclude> | </noinclude> |
Latest revision as of 03:00, 8 December 2024
{{{1}}} Shortcut template for emphasizing text with italics.
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; addsstyle="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; addsid="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); addsclass="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|italicize this text}}
- Renders as italicize this text
{{em|style=color:red|italicize and turn the color of the text red}}
- Renders as italicize and turn the color of the text red
{{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