Professional Documents
Culture Documents
Web App
Web App
What is CSS? The translate() method moves an element from its current position
(according to the parameters given for the X-axis and the Y-axis).
CSS stands for Cascading Style Sheets
The following example moves the <div> element 50 pixels to the right, and
CSS describes how HTML elements are to be displayed on screen, paper, or
100 pixels down from its current position:
in other media
CSS saves a lot of work. It can control the layout of multiple web pages all at
once
Why Use CSS? The rotate() method rotates an element clockwise or counter-clockwise
according to a given degree.
CSS is used to define styles for your web pages, including the design, layout
and variations in display for different devices and screen sizes. The following example rotates the <div> element clockwise with 20 degrees:
CSS 2D Transforms
CSS transforms allow you to move, rotate, scale, and skew elements.
In this chapter you will learn about the following CSS property: The scale() method increases or decreases the size of an element
(according to the parameters given for the width and height).
With the CSS transform property you can use the following 2D
transformation methods: The following example increases the <div> element to be two times of its
original width, and three times of its original height:
translate()
rotate()
scaleX()
scaleY()
scale()
skewX()
skewY(
The scaleX() method increases or decreases the width of an element. The following example skews the <div> element 20 degrees along the X-axis,
and 10 degrees along the Y-axis:
The following example increases the <div> element to be two times of its
original width:
CSS Transitions
The scaleY() method increases or decreases the height of an element. CSS transitions allows you to change property values smoothly, over a given
duration.
The following example increases the <div> element to be three times of its
original height: Specify the Speed Curve of the Transition
ease - specifies a transition effect with a slow start, then fast, then end
The skewX() method skews an element along the X-axis by the given angle. slowly (this is default)
The following example skews the <div> element 20 degrees along the X-axis: linear - specifies a transition effect with the same speed from start to end
The skew() method skews an element along the X and Y-axis by the given
angles.
The animation-fill-mode property specifies a style for the target element
when the animation is not playing (before it starts, after it ends, or both).
none - Default value. Animation will not apply any styles to the element
before or after it is executing
forwards - The element will retain the style values that is set by the last
keyframe (depends on animation-direction and animation-iteration-count)
backwards - The element will get the style values that is set by the first
keyframe (depends on animation-direction), and retain this during the
animation-delay period
CSS Animations both - The animation will follow the rules for both forwards and backwards,
extending the animation properties in both directions
CSS allows animation of HTML elements without using JavaScript or Flash!
When you specify CSS styles inside the @keyframes rule, the animation will
gradually change from the current style to the new style at certain times.
The animation-delay property specifies a delay for the start of an
animation.
Using var You have already learned that JavaScript variables are containers for data
values.
Using let
Using const
Using nothing