Jump to content
 







Main menu
   


Navigation  



Main page
Contents
Current events
Random article
About Wikipedia
Contact us
Donate
 




Contribute  



Help
Learn to edit
Community portal
Recent changes
Upload file
 








Search  

































Create account

Log in
 









Create account
 Log in
 




Pages for logged out editors learn more  



Contributions
Talk
 



















Contents

   



(Top)
 


1 Examples  





2 TemplateData  





3 See also:  














Template:Transform-rotate/doc







Add links
 









Template
Talk
 

















Read
Edit
View history
 








Tools
   


Actions  



Read
Edit
View history
 




General  



What links here
Related changes
Upload file
Special pages
Permanent link
Page information
Get shortened URL
Download QR code
 




Print/export  



Download as PDF
Printable version
 
















Appearance
   

 






From Wikipedia, the free encyclopedia
 

< Template:Transform-rotate

A shorthanded CSS code for rotating elements inside style attribute. Use it inside the style="" attribute of HTML elements like other CSS properties.

When using this template to create the rotating effect, editors should carefully consider the accessibility.

Examples[edit]

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:
<span style="{{Transform-rotate|90}}">5</span> <span style="{{Transform-rotate|180}}">5</span> <span style="{{Transform-rotate|270}}">5</span> <span style="{{Transform-rotate|360}}">5</span>
5 5 5 5
  • Some rotated special characters (useful when the font-family has no italic or oblique font):
<span style="font-size: 1.4em; {{Transform-rotate|0}}"></span> <span style="font-size: 1.4em; {{Transform-rotate|20}}"></span> <span style="font-size: 1.4em; {{Transform-rotate|40}}"></span> <span style="font-size: 1.4em; {{Transform-rotate|60}}"></span>
  • Works with numbers, too
<span style="{{Transform-rotate|0}}">0</span> <span style="{{Transform-rotate|10}}">1</span> <span style="{{Transform-rotate|20}}">2</span> <span style="{{Transform-rotate|30}}">3</span> <span style="{{Transform-rotate|40}}">4</span> <span style="{{Transform-rotate|50}}">5</span> <span style="{{Transform-rotate|60}}">6</span> <span style="{{Transform-rotate|70}}">7</span> <span style="{{Transform-rotate|80}}">8</span> <span style="{{Transform-rotate|90}}">9</span>
0 1 2 3 4 5 6 7 8 9
  • Or with arbitrary text
<span style="{{Transform-rotate|-90}}">This text<br />is vertically<br />aligned.</span><br />&nbsp;<br /><span style="{{Transform-rotate|-180}}">This text is upside down.</span>
This text
is vertically
aligned.

 
This text is upside down.
  • This is a placeholder image, It is rotated 90 degrees clockwise.
<div style="position:relative; top:0px; left:0px; {{Transform-rotate|90|display=block}}">[[file:Image PlaceHolder.png|200px]]</div>

  • This is a red horizontal line drawn across the text at the angle of 30 degree anticlockwise.
<div style="border:3px solid red; width:150px; position:relative; top:50px; opacity:0.5; {{Transform-rotate|-30|display=block}}"></div>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.

Serious limitation:

Syntax Result
<span style="{{Transform-rotate|90}}">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.</span>
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.

TemplateData[edit]

This is the TemplateData for this template used by TemplateWizard, VisualEditor and other tools. See a monthly parameter usage report for Template:Transform-rotate in articles based on its TemplateData.

TemplateData for Transform-rotate

No description.

Template parameters

ParameterDescriptionTypeStatus
Rotation angle1

Positive degrees rotate right, negative values rotate left

Default
0
Numberoptional
CSS displaydisplay

no description

Default
inline-block
Stringoptional

See also:[edit]



Retrieved from "https://en.wikipedia.org/w/index.php?title=Template:Transform-rotate/doc&oldid=1233425525"

Hidden category: 
Template documentation pages
 



This page was last edited on 9 July 2024, at 00:34 (UTC).

Text is available under the Creative Commons Attribution-ShareAlike License 4.0; additional terms may apply. By using this site, you agree to the Terms of Use and Privacy Policy. Wikipedia® is a registered trademark of the Wikimedia Foundation, Inc., a non-profit organization.



Privacy policy

About Wikipedia

Disclaimers

Contact Wikipedia

Code of Conduct

Developers

Statistics

Cookie statement

Mobile view



Wikimedia Foundation
Powered by MediaWiki