Template:Right: Difference between revisions

From MozillaWiki
Jump to navigation Jump to search
(from w:)
 
(Updated code to comply with HTML5 (attribute "align" deprecated), changed to CSS styling property "text-align". Old code archived at Template:Center/HTML4, if needed.)
 
(One intermediate revision by the same user not shown)
Line 1: Line 1:
<div align="right">{{{1}}}</div>
<div style="text-align: right;">{{{1}}}</div><noinclude>
{{documentation}}
<!-- Add categories to the /doc subpage, not here! -->
</noinclude>

Latest revision as of 11:03, 25 January 2015

{{{1}}}
Documentation icon Template documentation[view] [edit] [history] [purge]

Usage

{{right}} encloses the input text or element code in <div> tags and right-aligns the output block.

Note

This template complies with HTML5 standards. In HTML5, the attribute align is deprecated. Instead, the template uses the CSS styling attribute style and the property:value pair text-align:right, to right-align the output. If you need to use HTML4, use the template {{right/HTML4}}.

Parameters

There is only 1 parameter, which is unnamed and required.

Syntax

The template's syntax is

  • {{right|custom text/element}}

Required parameters

1

Custom text/element

The text (or other element) you wish to right-align. The parameter is unnamed, so no parameter name needs to be specified.

Usage
  • {{right|1}}

Examples

Case What you type What you see
Text {{right|This text is right-aligned}}
This text is right-aligned
Image {{right|[[File:Idea.png|20px|link=]]}}
Idea.png

See also

General alignment
Specific alignment
  • {{center}}: uses the CSS styling attribute style="…" for alignment (HTML5 compliant).
  • {{center/HTML4}}: uses the HTML4 attribute align="…" (deprecated in HTML5).
  • {{left}}: uses the CSS styling attribute style="…" for alignment (HTML5 compliant).
  • {{left/HTML4}}: uses the HTML4 attribute align="…" (deprecated in HTML5).
  • {{right/HTML4}}: uses the HTML4 attribute align="…" (deprecated in HTML5).