CSS Quiz Questions Flashcards
What are the names of the individual pieces of a CSS rule?
A selector, declaration block, property, value
How are key/value pairs related to CSS?
They allow you to edit elements on an HTML page
What are three important considerations for choosing fonts?
Readability, theme, fallback fonts
Why must you have backup fonts assigned when selecting custom fonts?
Incase the computer does not have the selected font
What CSS properties make up the box model?
margin, border, padding, content
Which CSS property pushes boxes away from each other?
margin
Which CSS property pushes box content away from its border?
padding
What purpose does the CSS Cascade serve?
What styling will take priority
What is source order?
The order the css has been written
In what situations might you need to apply styling to a single element multiple times in one stylesheet?
Mobile responsiveness (Phones)
What is inheritance?
When a child of an element gets a computed value that has been declared in the parent element
Why might CSS include the inheritance feature?
Timeliness
Is inheritance a good tool to use for styling? If so, on what occasions?
Yes. It cuts down on the amount of code you have to use, which saves time
What is the purpose of !important?
To override every style that has taken place prior
When is !important a good tool to use?
When it is crucial, but it is almost never to be used
What is specificity?
The strength of a specific css selector
How is specificity calculated?
through the weight of a css selector in the specificity hierarchy
Why might CSS include this feature?
To be more specific in choosing an element to style.
What is the order of selector strengths for CSS specificity (commonly referred to as the Specificity Hierarchy)?
id, class, element from greatest specificity to least
What is the CSS Cascade?
inheritance, source order, specificity, and importance