CSS Angles - HTML CSS CSS

HTML CSS examples for CSS:Angle

Introduction

You express angles as a number followed by a unit-for example, 360deg.

The following table shows the set of supported angle units.

Unit Identifier Description
deg Specifies the angle in degrees (values are from 0deg to 360deg)
gradSpecifies the angle in radians (values are from 0grad to 400grad)
rad Specifies the angle in radians (values are from 0rad to 6.28rad)
turnSpecifies the angle in complete turns (1turn is equal to 360deg)

The following code shows how to use the deg.

Demo Code

ResultView the demo in separate window


<!DOCTYPE HTML>
<html>
    <head>
        <title>Example</title>
        <style>
            p {<!--   w ww  . ja  v  a2 s  .  c o m-->
                padding: 5px;
                border: medium double black;
                background-color: lightgray;
                font-family: sans-serif;
            }
            #mySpan {
                font-size: x-large;
                border: medium solid white;
                background-color: green;
                color: white;
                padding: 4px;
                -moz-transform: rotate(-45deg) scaleX(1.2);

                  }
              </style>
          </head>
          <body>
              <p id="fruittext">
                  test <span id="mySpan">mySpan</span>
              </p>
          </body>
      </html>
      

Related Tutorials