Predefinição:Transform-rotate/doc

< Predefinição:Transform-rotate
Revisão de 17h32min de 3 de janeiro de 2020 por Mariliasi (discussão | contribs) (uma edição)
(dif) ← Edição anterior | Revisão atual (dif) | Versão posterior → (dif)

{{#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 to display: 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
  • Some rotated characters:
<source lang="html">5 5 5 5</source> 5 5 5 5
  • Some rotated special characters (useful when the font-family has no italic or oblique font):
<source lang="html"> </source>
  • Works with numbers, too
<source lang="html">0 1 2 3 4 5 6 7 8 9</source> 0 1 2 3 4 5 6 7 8 9
  • Or with arbitrary text
<source lang="html">This text
is vertically
aligned.

 
This text is upside down.</source>
This text
is vertically
aligned.

 
This text is upside down.
  • This is a placeholder image, It is rotated 90 degrees clockwise.
<source lang="html"></source>
  • This is a red horizontal line drawn across the text at the angle of 30 degree anticlockwise.
<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.

See also: