AIT Experiment no 2
Ait
exp 2
Translation
:
<!DOCTYPE html>
<html>
<head>
<style>
div {
width: 100px;
height: 100px;
background-color: gold;
border: 1px solid black;
}
div#myDiv {
-ms-transform: translate(50px,10px); /* IE 9 */
-webkit-transform: translate(50px,10px); /* Safari */
transform: translate(50px,10px); /* Standard syntax */
}
</style>
</head>
<body>
<div>
before translation.
</div>
<div id="myDiv">
after translation
</div>
</body>
</html>
Output
:
Rotation
:
<!DOCTYPE html>
<html>
<head>
<style>
div {
width: 300px;
height: 100px;
background-color: yellow;
border: 1px solid black;
}
div#myDiv {
-ms-transform: rotate(20deg); /* IE 9 */
-webkit-transform: rotate(20deg); /* Safari */
transform: rotate(20deg); /* Standard syntax */
}
</style>
</head>
<body>
<div>
This a normal div element.
</div>
<div id="myDiv">
The rotate() method rotates an element
clockwise or counter-clockwise. This div element is rotated clockwise 20
degrees.
</div>
</body>
</html>
Output
:
Matrix
:
<!DOCTYPE html>
<html>
<head>
<style>
div {
width: 400px;
height: 100px;
background-color: gold;
border: 5px solid black;
}
div#myDiv1 {
-ms-transform: matrix(1, -0.3, 0, 1, 0, 0); /* IE 9 */
-webkit-transform: matrix(1, -0.3, 0, 1, 0, 0); /* Safari */
transform: matrix(1, -0.3, 0, 1, 0, 0); /* Standard syntax */
}
div#myDiv2 {
-ms-transform: matrix(1, 0, 0.5, 1, 150, 0); /* IE 9 */
-webkit-transform: matrix(1, 0, 0.5, 1, 150, 0); /* Safari */
transform:
matrix(1, 0, 0.5, 1, 150, 0); /* Standard syntax */
}
</style>
</head>
<body>
<p>The matrix method</p>
<div>
This a normal div element.
</div>
<div id="myDiv1">
Using the matrix() method.
</div>
<div id="myDiv2">
Another use of the matrix() method.
</div>
</body>
</html>
Output
:
AIT Experiment no 2
Reviewed by Akshay Salve
on
3:37 PM
Rating:
No comments: