Java9 - Css3 (II)
Java9 - Css3 (II)
Lenda: Interneti
Java: IX (e nente) - Ushtrime
Tema: CSS3 - Cascading Style Sheets 3 (II)
Prmbajtja:
CSS3 2D Transforms
CSS3 3D Transforms
CSS3 Transitions
CSS3 Animations
CSS3 Prmbledhje
CSS3 2D Transforms
With CSS3 transform, we can move, scale, turn,
spin, and stretch elements.
A transform is an effect that lets an element
change shape, size and position.
You can transform your elements using 2D or 3D
transformation.
Browser Support
Example
div
{
transform: translate(50px,100px);
-ms-transform: translate(50px,100px); /* IE 9 */
-webkit-transform: translate(50px,100px); /* Safari and
Chrome */ }
Example
div
{
transform: rotate(30deg);
-ms-transform: rotate(30deg); /* IE 9 */
-webkit-transform: rotate(30deg); /* Safari and Chrome */
}
Example
div
{
transform: skew(30deg,20deg);
-ms-transform: skew(30deg,20deg); /* IE 9 */
-webkit-transform: skew(30deg,20deg); /* Safari and Chrome
*/ }
2D Transform Methods
CSS3 3D Transforms
CSS3 allows you to format your elements using
3D transforms.
We will learn about some of the 3D transform
methods:
rotateX()
rotateY()
Browser Support
Example
div
{
transform: rotateX(120deg);
-webkit-transform: rotateX(120deg); /* Safari and
Chrome */
}
Example
div
{
transform: rotateY(130deg);
-webkit-transform: rotateY(130deg); /* Safari and
Chrome */
}
CSS3 Transitions
With CSS3, we can add an effect when changing
from one style to another, without using Flash
animations or JavaScripts.
Browser Support
Example
Transition effect on the width property, duration: 2 seconds:
div
{
transition: width 2s;
-webkit-transition: width 2s; /* Safari */
}
CSS3 Animations
With CSS3, we can create animations, which
can replace animated images, Flash animations,
and JavaScripts in existing web pages.
CSS3 @keyframes Rule
To create animations in CSS3, you will have to
learn about the @keyframes rule.
The @keyframes rule is where the animation is
created. Specify a CSS style inside the
@keyframes rule and the animation will
gradually change from the current style to the
new style.
Example
@keyframes myfirst
{
from {background: red;}
to {background: yellow;}
}
@-webkit-keyframes myfirst /* Safari and Chrome */
{
from {background: red;}
to {background: yellow;}
}
CSS3 Prmbledhje