codescracker


css

CSS Rotate Box



« Previous Tutorial Next Tutorial »


CSS allows you to rotate the content of an HTML element by using the rotation and rotation-point properties.

CSS rotation

The rotation property rotates the content of an HTML element according to the specified values in degree. It rotates the element content around a given point defined by the rotation-point property.

The syntax of using the rotation property is given as follows:

rotation: <angle> ;

In the preceding syntax, <angle> specifies the number of degrees up to which the element needs to be rotated.

CSS rotation-point

The rotation-point property defines a point as an offset from the top left border edge.

The syntax of using the rotation-point property is given as follows :

rotation-point: <bg-position> ;

In the preceding syntax, <bg-position> specifies the values that defines a point as an offset from the top left border edge.

CSS rotation and rotation-point Example

Following is an example of using the rotation and rotation-point properties is given as follows :

h1 { rotation: 45deg; rotation-point: bottom left; }

« Previous Tutorial Next Tutorial »



Tools
Calculator

Quick Links
Signup - Login - Give Online Test