transform: rotate(45deg);
transform: rotate(3.1416rad);
transform: rotate(-50grad);
transform: rotate(1.75turn);
<section class="default-example" id="default-example">
<div class="transition-all" id="example-element">
This box can rotate to different angles.
</div>
</section>
#example-element {
background-color: #0118f3;
padding: 0.75em;
width: 180px;
height: 120px;
color: white;
}
<angle>資料型別由一個<number>後跟以下列出的其中一個單位組成。與所有尺寸一樣,單位字面量和數字之間沒有空格。在數字0之後,角度單位是可選的。
可選地,它前面可以有一個+或-號。正數表示順時針角度,而負數表示逆時針角度。對於給定單位的靜態屬性,任何角度都可以用各種等效值表示。例如,90deg等於-270deg,1turn等於4turn。對於動態屬性,例如應用animation或transition時,效果將仍然不同。