CSS More Properties Flashcards
What is Alpha Channel
In RGB there is an “a (alpha channel)” which control transparency. 0 being completely transparent, and 1 being non transparent.
rgba (255,255,255,0.7)
Define Opacity
Opacity is a property set on an element which governs transparency for entire element. 0-1, 1 being non transparent.
How do you change transparency on hexadecimal colors
00-FF, ff being non transparent
List position properties
Sets how an element is positioned. Static Absolute Fixed Sticky
Static Position
Static - default (top, right, bottom, left has no effect)
Relative Position
Relative - Allows TRBL to have effect relative to original position
Absolute Position
Absolute - Element is removed from document flow. TRBL effects position relative to closest ancestor
Fixed Position
Fixed - Element is removed from document flow. Similar to absolute but not relative to any ancestor position. Stays in place when scrolling. ie Nav Bar
Sticky Position
Sticky - Starts as static then behaves like fixed.
What are the four things we can specify in Transitions.
- Property we want to animate
- Duration set in seconds (ms)
- Transition-timing-function
- Delay (default no delay)
What does transform do?
Transform can rotate, translate(move), scale(size), skew, etc.
transform: translateX(2em);
transform: skewY(45deg);
How do you combine transform properties. Rotated 90 degrees and half scale.
You can combine by a space.
transform:rotate(90deg) scale(0.5);
Transform - flip upside down, double the size, skew by 45 deg on X-axis and 25 deg on Y-axis, and shift it 300 pixels to the left.
transform:rotate(180deg) scale(2) skewX(45deg) skewY(25deg) translate(300px)
How do you add a Background image.
background-image: url(https://image.here.com);
What are common background sizing property options?
background-size: contain; (scale everything large as possible without cropping or stretching, but repeats.)
background-size: cover; (scale to largest without stretching but will crop.)
background-size: 30% (shrink to 30% of original.)
background-size: 200px 100px (x and y sizing.)