CSS Flashcards
What CSS properties make up the box model?
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 class applied to a selector that specifies a special state of the selected element
What are CSS pseudo-classes useful for?
applying styling based on user actions not only in relation to the content of the document tree, but also in relation to external factors like the history of the navigator (:visited, for example), the status of its content (like :checked on certain form elements), or the position of the mouse
What are some examples of a pseudo-class?
:hover, :active, :focus, :link, :visited
Name at least two units of type size in CSS.
rem, px, pt
What CSS property controls the font used for the text inside an element?
font-family
What are the names of the individual pieces of a CSS rule?
selector {property: value}
…declaration = property:value
In CSS, how do you select elements by their class attribute?
.class-name {
property: value
}
In CSS, how do you select elements by their type?
p {
property: value
}
In CSS, how do you select an element by its id attribute?
#id-element { property: value }
Name three different types of values you can use to specify colors in CSS.
rgb/a, color keywords (black, red, blue, etc), hex codes
What is the default flex-direction of a flex container?
row
What is the default flex-wrap of a flex container?
nowrap (all flex items will be on one line)