CSS Deck 3 Flashcards
Opactity
Opactity:0;
The element will only be visually hidden, but its space will still be allocated
Users can still focus on the element through the keyboard and the element receives click elements
Allows to transition (to create a fading effect)
Visibility
visibility:hidden;
The element will be visually hidden but space will still be allocated
Users cannot focus on the element of interacting with it. The element does not receive click events
Child elements can be made visible by changing their visbility
Display
display:none;
Space itself will not be allocated for the element
It is similar to if the element were no present in the DOM iteself
CSS Mistakes: Overly Specific Selectors
Affects readability, and gives yourself a hard time to debug
CSS Mistakes: Using Color Names
Different browsers may have different values for color names
CSS Mistakes: Not using shorthands
Simplifies code and limits repetition
CSS Mistakes: Not Modularizing
Putting your styles across multiple files helps keep code organized and easier to debug
CSS Mistakes: Repeating things
Try to keep that limited – especially if elements share styles
CSS Mistakes: Not Optimizing
Always minify your stylesheet after development to reduce file size
Use any optimizer to remove any unused styles that bloat your stylesheet