CSS Flashcards
What are the names of the individual pieces of a CSS rule?
Selector, declaration block, properties
In CSS, how do you select elements by their class attribute?
By including a . before the selector
In CSS, how do you select elements by their type?
By using the element names
In CSS, how do you select an element by its id attribute?
By including a # before the selector
Name three different types of values you can use to specify colors in CSS.
RGB, Hex and Color names
What CSS properties make up the box model?
Border, margin and padding
Which CSS property pushes boxes away from each other?
Margin
Which CSS property adds space between a box’s content and its border?
Padding
What is a pseudo-class? A class applied to an element by the browser in a special circumstance.
They can change the appearance of elements when users are interacting with them
What are CSS pseudo-classes useful for?
Applying styling based on user actions. Style to an element in relation to the content to the document tree and other like the history (visited), status (checked) or position (hover)
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
What is the default flex-wrap of a flex container?
Nowrap
Why do two div elements “vertically stack” on one another by default?
Because they are block elements