CSS Flashcards
What are the names of the individual pieces of a CSS rule?
Selector, declaration, property/key, value
In CSS, how do you select elements by their class attribute?
Use .classname (period before the class name)
In CSS, how do you select elements by their type?
Use the element name (h1, p, etc)
In CSS, how do you select an element by its id attribute?
Use a hashtag before the id name (#idname)
Name three different types of values you can use to specify colors in CSS.
RGB, hex codes, color names
What CSS properties make up the box model?
(Width, height,) 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 modification of a css selector which changes the appearance of elements when the user interacts with them
What are CSS pseudo-classes useful for?
Can apply a hovering effect, can show when an element is being activated, and can show when an element has focus
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?
Left to right
What is the default flex-wrap of a flex container?
Nowrap (all on one line)
Why do two div elements “vertically stack” on one another by default?
They are block elements