CSS Flashcards
Name three different types of values you can use to specify colors in CSS.
Color names
Hex codes
RGB values
What are the names of the individual pieces of a CSS rule?
selector { declaration property name: declaration property value; }
How are key/value pairs related to CSS?
key/value = name/value
In CSS: property name / property value
What are three important considerations for choosing fonts?
Readability
Installed fonts
Sticking with theme
Why must you have backup fonts assigned when selecting custom fonts?
Fallback fonts in case the selected font is not installed on user’s computer
Read the code.
background-color : rgb (0, 0, 0)
There is a property of background color with the value of rgb css function and three parameters of 0, 0 0
What CSS properties make up the box model?
Margin
Border
Padding
Content
What CSS property pushes boxes away from each other?
Margin property
What CSS property pushes box content away from its border?
Padding property
What purpose does the CSS Cascade serve?
Determines what styling will be applied to an element
What is source order?
The order CSS rules are written in a stylesheet
In what situations might you need to apply styling to a single element multiple times in one stylesheet?
Mobile responsiveness
What is inheritance?
For certain properties, when applied to a parent element will also get taken on by any child elements
*usually font or text related
Why might CSS include inheritance?
Save developers time & keep code DRY
What is the purpose of !important?
Highest level of importance for CSS rule
When is !important a good tool to use?
Almost never
What is specificity?
The weight or importance placed on different types of selectors
How is specificity calculated?
Numerical:
0.0.0
(tag selector, class selector, id selector)
Why might CSS include specificity?
Gives a tool to add more specificity if needed
To override specificity of an element
What is the order of selector strengths for CSS specificity?
Tag selectors
Class selectors
ID selectors