Difference between revisions of "Template:Rotate"

From MansunWiki
Jump to: navigation, search
m
 
(2 intermediate revisions by the same user not shown)
Line 1: Line 1:
<includeonly>{{#define:1|90}}{{#define:float|{{{3|none}}}}}{{#if:{{{2|}}}|<div style="}}float:{{{float}}}; transform:rotate({{{1}}}deg);-moz-transform:rotate({{{1}}}deg);-webkit-transform:rotate({{{1}}}deg);-o-transform:rotate({{{1}}}deg);-ms-transform:rotate({{{1}}}deg);{{#if:{{{2|}}}|">{{{2}}}</div>}}</includeonly><noinclude>{{Documentation}}</noinclude>
+
<includeonly>{{{3|none}}}{{#if:{{{2|}}}|<div style="}}float:{{{float}}}; transform:rotate({{{1}}}deg);-moz-transform:rotate({{{1}}}deg);-webkit-transform:rotate({{{1}}}deg);-o-transform:rotate({{{1}}}deg);-ms-transform:rotate({{{1}}}deg);{{#if:{{{2|}}}|">{{{2}}}</div>}}</includeonly><noinclude>{{Documentation}}</noinclude>

Latest revision as of 19:23, 16 August 2015

[view] [edit] [history] [purge] Template-info.svg Template Documentation

Summary

This is a basic template that returns the CSS style text required to rotate text. It is cross-browser compatible, but due to inconsistencies within the browsers themselves the text may display slightly differently. Note that due to the weirdness of rotated text, you may need to further format the text to get it to display how you want it to.

Parameters

1 - required|The degrees by which to rotate the text, on a scale of 1 to 360. 2 - optional|The text to rotate. If not defined, the template will return the CSS style text only. 3 or float|optional|What side of the page the text should float to. Defaults to left.


Examples

Stand-alone

{{Rotate|180|This is upside down!}}
none
This is upside down!


{{Rotate|80|This is the right side!|right}}
right
This is the right side!


Within a Container

<div style="{{Rotate|45|float=left}}; font-size:8px;">I'm tiny!</div>
I'm tiny!


{| class=wikitable
! Header !! {{Rotate|180|Header}}
|-
|style="{{Rotate|325}}"|This entire cell<br>is rotated! || But not this one!
|}
Header none
Header
This entire cell
is rotated!
But not this one!