CSS Flashcards
Name three different types of values you can use to specify colors in CSS
Hex , color name, rgb
Why is using !important considered bad practice?
it makes debugging more difficult
List the three selector types in order of increasing specificity.
type, class, ID
How is it possible for the styles of an element to be applied to its children as well
without an additional CSS rule?
Inheritance
What does the term “source order” mean with respect to CSS?
the order that your CSS rules are written in your stylesheet.
Top=weaker
Bottom=Stronger
What are the four components of “the Cascade”.
Inheritance, Specificity, !important, Source Order
What CSS properties make up the box model?
Height Width Border Margin Padding
Which CSS property pushes boxes away from each other?
MARGIN
Which CSS property add space between a box’s content and its border?
Padding is the space between the border of a box and any content contained within it.
Name two types of units that can be used to adjust font-size in CSS.
Pixels & Percentages
What CSS property controls the font used for the text inside an element?
The font-family property allows you to specify the typeface that should be used for any text inside the element(s) to which a CSS rule applies.
What is a pseudo-class?
A CSS pseudo-class is a keyword added to a selector that specifies a special state of the selected element(s).
What are CSS pseudo-classes useful for?
All pseudo-classes behave in this same kind of way. They target some bit of your document that is in a certain state, behaving as if you had added a class into your HTML. Take a look at some other examples on MDN:
What is the default value for the position property of HTML elements?
Static Position
How does setting position: relative on an element affect document flow?
normal flow