CSS Flashcards
What are the names of the individual pieces of a CSS rule?
Selectors, declaration block, declarations, properties, and values.
(All pieces make a Ruleset)
In CSS, how do you select elements by their class attribute?
Elements are targeted by their class attribute by [.attributevalue] before the declaration block.
In CSS, how do you select elements by their tag name?
Elements are targeted by their tag name by [tagname] before the declaration block.
In CSS, how do you select an element by its id attribute?
Elements are targeted by their class attribute by [#attributevalue] before the declaration block.
Name three different types of values you can use to specify colors in CSS.
RGB values, Hex codes, and color names.
(i.e., rgb(102, 205, 170), #66CDAA, MediumAquaMarine)
What CSS properties make up the box model?
Border, margin, and padding, and content (width and height).
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.
What is a pseudo-class?
A pseudo-class specifies a special state for the selected element(s).
What are CSS pseudo-classes useful for?
Pseudo-classes apply styles to an element in relation to external factors.
(i.e., navigation history and mouse hover)
Name two types of units that can be used to adjust font-size in CSS.
Pixels and Rems. (Also percentages and Ems)
What CSS property controls the font used for the text inside an element?
The font-family CSS property.
What is the default flex-direction of a flex container?
The default flex-direction of a flex container is row (left to right).
What is the default flex-wrap of a flex container?
The default flex-wrap of a flex container is nowrap (all flex items will be on one line).
Why do two div elements “vertically stack” on one another by default?
Div elements are considered block-level elements which take up the full width of its container element.