CSS3
CSS3
History of CSS
CSS modules
CSS
CSS
CSS
CSS
CSS
CSS
CSS
CSS
CSS
CSS
CSS
CSS
CSS
CSS
(selection)
Color
Namespaces
Selectors
Media Queries
Backgrounds & Borders
2D Transformations
Transitions
Animations
3D Transformations
Flexible Box Layout
Fonts
Text
Grid Layout
Image Values and Replaced Content
Linear gradient
background: linear-gradient([direction], color-stop1, color-stop2,)
color-stop=blue, red, .., rgb(rrr, ggg, bbb), rgba(rrr, ggg, bbb, aaa)
where aaa=1 (no transparency) and aaa=0 (full transparency)
the parameters are the same as for the simple linear gradient
shape=circle or ellipse
2D Transforms (1)
2D Transforms (2)
scale(x,y) changes the width to x times the original and the height
ex.: rotate(45deg);
3D Transforms (1)
3D Transforms (2)
3D transform functions:
translate3d(x,y,z)
translateX(x)
translateY(y)
translateZ(z)
scale3d(x,y,z)
scaleX(x)
scaleY(y)
scaleZ(z)
rotate3d(x,y,z,angle)
rotateX(angle)
rotateY(angle)
rotateZ(angle)
perspective(n)
matrix3d(n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n) 3D transform 4x4 matrix
Transitions - properties
Transitions - examples
simple example:
div {
transition-property: width;
transition-duration: 5s;
}
div:hover { width: 100px }
}
div:hover {
width: 100px;
transform: rotate(90deg);
}
Animations - properties
Animations - @keyframes
@keyframes name-of-animation {
keyframe-selector {
property: value;
property: value;
}
keyframe-selector {
property: value;
property: value;
}
}
keyframe-selector is either from (=0%), to (=100%) or a percent of animation
Duration from 0% to 100%.
property is a CSS property.
Animations - example
@keyframes move {
0% { left: 100px; }
40% { left: 130px; }
100% { left: 150px; }
}
div {
animation: move 5s;
}
Multiple columns
div {
columns: 40px 2;
}
Borders
Text shadow
Stylus
Compass
Less