CSS Flashcards
What are the names of the individual pieces of a CSS rule?
The CSS Selector, Declaration block, property and value.
In CSS, how do you select elements by their class attribute?
To select by class attribute you use the dot operator e.g. ‘.class’.
In CSS, how do you select elements by their type?
To select an element by type you use it as the selector e.g. ‘h1’.
In CSS, how do you select an element by its id attribute?
To select an element by ID you use ‘#’ e.g. ‘#ID’.
Name three different types of values you can use to specify colors in CSS.
You can specify colors with Hex, rgba(), and keywords.
Hsl() is also an option.
What is a pseudo-class?
A psuedo-class is used to define special states of an element. e.g. ‘:hover’.
What are CSS pseudo-classes useful for?
Pseudo classes are useful for decorating smaller scale, reactive parts of an element.
What CSS properties make up the box model?
The box model properties are: Margin, Border, Padding, and Content.
Which CSS property pushes boxes away from each other?
The Margin property pushes boxes away from each other.
Which CSS property add space between a box’s content and its border?
The Padding property adds space between a box’s content and its border.
Name at least two units of type size in CSS.
Font size can use all ‘length’ units. e.g. ‘em, px, %, pt’.
What CSS property controls the font used for the text inside an element?
The Font-family property controls the font used for an element.
What is the default flex-direction of a flex container?
The default value for flex-direction is ‘row’.
What is the default flex-wrap of a flex container?
The default value of flex-wrap is ‘nowrap’.
Why do two div elements “vertically stack” on one another by default?
Div elements vertically stack because their display type is ‘block’.