Template:Transform-rotate/doc
Template:Mbox
A shorthanded CSS code for rotating elements inside style attribute. Use it inside the style=""
attribute of HTML elements like other CSS properties.
- First unnamed parameter
{{{1}}}
for rotation angle (in degree). Positive values rotate right, negative values rotate left. - The named parameter Template:Para allows you to change the CSS display property. It defaults to
display: inline-block;
When using this template to create the rotating effect, editors should consider carefully about the accessibility.
Template:A note This template does not support IE8 or older. IE8 requires cumbersome calculating of matrices. You may implement it into this template if you know how to translate the formula into Lua.
Examples
The rotating happens at the center of the object and its effective dimensions will retain the original values of the object as if unrotated, so you may adjust the position and padding to avoid unwanted overlapping. Use the display=
parameter to further control positioning.
Syntax | Result |
---|---|
| |
<syntaxhighlight lang="html">5 5 5 5</syntaxhighlight> | 5 5 5 5 |
| |
<syntaxhighlight lang="html">∫ ∫ ∫ ∫</syntaxhighlight> | ∫ ∫ ∫ ∫ |
| |
<syntaxhighlight lang="html">0 1 2 3 4 5 6 7 8 9</syntaxhighlight> | 0 1 2 3 4 5 6 7 8 9 |
| |
<syntaxhighlight lang="html">This text is vertically aligned. This text is upside down.</syntaxhighlight> |
This text is vertically aligned. This text is upside down. |
| |
<syntaxhighlight lang="html"></syntaxhighlight> | |
| |
<syntaxhighlight lang="html">Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.</syntaxhighlight> | Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. |
Serious bug:
Syntax | Result |
---|---|
<syntaxhighlight lang="html">The text will be rotated, but not the space the text need to display. So the cell is not tall enough, but much much too wide.</syntaxhighlight> | The text will be rotated, but not the space the text need to display. So the cell is not tall enough, but much much too wide. |
See also: