CSS Flashcards
What are the names of the individual pieces of a CSS rule?
Selector, declaration block, properties, values
In CSS, how do you select elements by their class attribute?
.className
In CSS, how do you select elements by their type?
elementName
In CSS, how do you select an element by its id attribute?
idName, octothorpe
Name different types of values you can use to specify colors in CSS.
Hex, rgb, color name, rgba, (HSL, hsla (not used frequently))
What CSS properties make up the box model?
Border, margin, padding, (content: width and height)
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 class that is applied by the browser to an element in a specific circumstance. They can change the appearance of elements when the user interacts with them.
What are CSS pseudo-classes useful for?
Styling elements based on user actions
Name at least two units of type size in CSS.
Percentage, pixels, em, rem
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 “div” is a block-level element