CSS32Dtransforms
CSS32Dtransforms
The following table has contained common values which are used in 2D
transforms
Values Description
translate(x,y) Used to transforms the element along with x-axis and y-axis
The following examples are shown the sample of all above properties
Rotate 20 degrees
Box rotation with 20 degrees angle as shown below
<html>
<head>
<style>
div {
width: 300px;
height: 100px;
background-color: pink;
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>
<html>
<head>
<style>
div {
width: 300px;
height: 100px;
background-color: pink;
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>
Skew X axis
Box rotation with skew x-axis as shown below
<html>
<head>
<style>
div {
width: 300px;
height: 100px;
background-color: pink;
border: 1px solid black;
div#skewDiv {
/* IE 9 */
-ms-transform: skewX(20deg);
/* Safari */
-webkit-transform: skewX(20deg);
/* Standard syntax */
transform: skewX(20deg);
</style>
</head>
<body>
<div>
Tutorials point.com.
</div>
<div id="skewDiv">
Tutorials point.com
</div>
</body>
</html>
Skew Y axis
Box rotation with skew y-axis as shown below
<html>
<head>
<style>
div {
width: 300px;
height: 100px;
background-color: pink;
div#skewDiv {
/* IE 9 */
-ms-transform: skewY(20deg);
/* Safari */
-webkit-transform: skewY(20deg);
/* Standard syntax */
transform: skewY(20deg);
</style>
</head>
<body>
<div>
Tutorials point.com.
</div>
<div id="skewDiv">
Tutorials point.com
</div>
</body>
</html>
Matrix transform
Box rotation with Matrix transforms as shown below
<html>
<head>
<style>
div {
width: 300px;
height: 100px;
background-color: pink;
div#myDiv1 {
/* IE 9 */
/* Safari */
</style>
</head>
<body>
<div>
Tutorials point.com.
</div>
<div id="myDiv1">
Tutorials point.com
</div>
</body>
</html>
<html>
<head>
<style>
div {
width: 300px;
height: 100px;
background-color: pink;
div#myDiv2 {
/* IE 9 */
/* Safari */
/* Standard syntax */
</style>
</head>
<body>
<div>
Tutorials point.com.
</div>
<div id="myDiv2">
Tutorials point.com
</div>
</body>
</html>