CSS Flashcards
What are the four components of “the Cascade”
Source order, inheritance, !important, specificity
What does the term “source order” mean with respect to CSS?
The lower styling code blocks take priority than those above
How is it possible for the styles of an element to be applied to its children well without an additional CSS rule?
By using inheritance to pass down properties to the children
List the three selector types in order of increasing specificity.
class, type, id
Why is using !important considered bad practice
it can messes with the natural order of cascading style sheets and debugging.
What are the names of individual pieces of a css rule
declaration blocks
How do you select elements by their class attribute
.class-name by using the .
How do you select elements by their type
tag-name just by using their tag name although it’s not recommended
How do you select an element by its id attribute
id-name by using an octothrope
Name three different types of values you can use to specify colors in CSS
rgb, lexicon values, and names
What CSS properties make up the box model?
Boxes model is a box made up of the margin, padding, and content
Which css property pushes boxes away from each other
Margin
which css property add space between a box’s content and its border
Padding
What is a pseudo-class
They target (or select) specific states of the element and change them based on what’s in the code block
What are CSS pseudo-classes useful for?
If you want to change specific areas in the css instead of the creating multiple classes, for example lists if you want to change the color of every other list item then there’s a pseudo class for that