CSS Flashcards
What are the names of the individual pieces of a CSS rule?
Selector, Declaration Block, property, value
In CSS, how do you select elements by their class attribute?
.class
In CSS, how do you select elements by their type?
Use the 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: rgb(102,205,170)
Hex Codes: #66cdaa
Color Names: MediumAquaMarine
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 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?
Pseudo-classes let you apply a style to an element not only in relation to the content of the document tree, but also in relation to external factors like the history of the navigator (:visited, for example), the status of its content (like :checked on certain form elements), or the position of the mouse (like :hover, which lets you know if the mouse is over an element or not).
Name at least two units of type size in CSS.
Pixels, percentages, ems
What CSS property controls the font used for the text inside an element?
font-family
What is the default flex-direction of a flex container?
Row (inline, x-axis)
What is the default flex-wrap of a flex container?
No wrap (inline)
What are the four components of “the Cascade”.
Source Order, Inheritance, !Important, Specificity
What does the term “source order” mean with respect to CSS?
Source order is the order that your CSS rules are written in your stylesheet. The one on the bottom has priority as long as all the types above it are the same
How is it possible for the styles of an element to be applied to its children as well without an additional CSS rule?
Inheritance