Mudanças entre as edições de "Predefinição:Transform-rotate/doc"
(→Examples) |
m (uma edição) |
(Sem diferença)
|
Edição atual tal como às 17h32min de 3 de janeiro de 2020
{{#ifeq:doc |doc
|
{{#ifeq:show |show
| Predefinição:Mbox }}{{#if: | | {{#ifexist:Predefinição:Transform-rotate | [[Category:{{#switch:Predefinição |Template=Template |Module=Module |User=User |#default=Wikipedia}} documentation pages]] | }} }} | }}
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
|{{SAFESUBST:#if:display|display=}}
allows you to change the CSS display property. It defaults todisplay: inline-block;
When using this template to create the rotating effect, editors should consider carefully about the accessibility.
16px {{safesubst:#if:|{{{1}}}|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 |
---|---|
| |
<source lang="html">5 5 5 5</source> | 5 5 5 5 |
| |
<source lang="html">∫ ∫ ∫ ∫</source> | ∫ ∫ ∫ ∫ |
| |
<source lang="html">0 1 2 3 4 5 6 7 8 9</source> | 0 1 2 3 4 5 6 7 8 9 |
| |
<source lang="html">This text is vertically aligned. This text is upside down.</source> |
This text is vertically aligned. This text is upside down. |
| |
<source lang="html"></source> | |
| |
<source lang="html">Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.</source> | Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. |
Serious bug:
Syntax | Result |
---|---|
<source 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.</source> | 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. |