CSS Quiz Questions Flashcards
What are the names of the individual pieces of a CSS rule?
selector {
(declaration block)
property: value;
}
How are key/value pairs related to CSS?
within a declaration block
there are properties(keys) and values
Name three different types of values you can use to specify colors in CSS.
color keyword: (blue);
hexadecimal value: #ffffff
RGB function: rgb(255,255,255)
What are three important considerations for choosing fonts?
- Readability,
- Availability: if it is used as a default on certain browsers.
- Does it work with the theme of the website (professional/casual etc)
Why must you have backup fonts assigned when selecting custom fonts?
In case your first choice of font is not recognized by certain browsers/computers.
What CSS properties make up the box model?
Content > Padding > Border > Margin
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?
It determines what styling properties take priority and inheritance of others (ie: if there are two different values for the same property)
What is source order?
The order that the css rules are written
In what situations might you need to apply styling to a single element multiple times in one stylesheet?
ie: if you wanted to change the styling of content dynamically(with a button press)
What is inheritance?
Child elements will acquire the css rules from their parent elements
Why might CSS include this feature?
Makes things easier and more efficient
What is the purpose of !important?
Makes a css property supersede all other properties
When is !important a good tool to use?
Usually never
What is specificity?
The priority of which css rules take place on an element (selector strength)
How is specificity calculated?
There is a numeric value associated with every selector, and the higher value will take priority. If the values are equal then source order wins
Why might CSS include this feature?
To make sure certain styling does not get overwritten accidentally by other selectors
What is the order of selector strengths for CSS specificity (commonly referred to as the Specificity Hierarchy)?
* universal, div (element selector), .class selector, :pseudoclass, #id selector, style="inline-styling", !important Refer to SpeciFISHity bookmark
What is the CSS Cascade?
The whole umbrella of factors to determine html styling priorities such as: inheritance, specificity, importance.