css Flashcards
What are the names of the individual pieces of a CSS rule?
Selector and declaration, property: value
In CSS, how do you select elements by their class attribute?
.class
In CSS, how do you select elements by their type?
element name
In CSS, how do you select an element by its id attribute?
id
Name three different types of values you can use to specify colors in CSS.
RGB values, hex codes, color names
What CSS properties make up the box model?
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
What is a pseudo-class?
a keyword added to a selector that specifies the state of the element
What are CSS pseudo-classes useful for?
Applying styles to an element in relation to the content of the document tree and external factors
ex) hover, checked, visited, nth-child
Name two types of units that can be used to adjust font-size in CSS.
pixels or percentages or rem
What CSS property controls the font used for the text inside an element?
font-family
What are the four components of “the Cascade”.
Source order, Inheritance, Specificity, and !important
What does the term “source order” mean with respect to CSS?
The order in which the style is written, the last ruleset will be applied.
How is it possible for the styles of an element to be applied to its children as well without an additional CSS rule?
The styles can be inherited from the parent from already being an inherited property or by specifying inheritance.