Rotate div to -20 degrees angle with CSS


You can try to run the following code to rotate div to -20 degrees angle with CSS −

Example

Live Demo

<html>
   <head>
      <style>
         div {
            width: 300px;
            height: 100px;
            background-color: pink;
            border: 1px solid black;
         }
         div#myDiv {
            /* IE 9 */
            -ms-transform: rotate(-20deg);
            /* Safari */
            -webkit-transform: rotate(-20deg);
            /* Standard syntax */
            transform: rotate(-20deg);
         }
      </style>
   </head>
   
   <body>
      <div>
         Tutorials point.com.
      </div>
      
      <div id = "myDiv">
         Tutorials point.com
      </div>
   </body>
   
</html>

Output

CSS Rotate

Updated on: 30-Jul-2019

438 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements