CSS Flashcards
what are the names of the individual pieces of a css rule?
selector, declaration
in css, how do you select elements by their class attribute?
.className
in css, how do you select elements by their type?
the name of the element
in css, how do you select an element by its id attribute?
IDname
name 3 different types of values you can use to specify colors in css
rbg values, hex codes, color names.
what css properties make up the box model?
margin, padding, border
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?
specifies a special state of the selected element
what are css pseudo-classes useful for?
changing styles based on user interaction
name at least two units of type size in css
pixels, 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
no wrap
why do two div elements vertically stack on one another by default
divs are block elements
what is the default flex-direction of an element with display: flex?
row
what is the default value for the position property of HTML elements?
static
how does setting position:relative on on element affect document flow?
doesn’t move other elements
how does setting position:relative on an element affect where it appears on a page?
appears in relation to its original position
how does setting position:absolute on an element affect where it appears on a page?
it is positioned within the first non-static ancestor.
how do you constrain an absolutely positioned element to a containing block?
by setting the block position to anything other than static.
what are the 4 offset properties?
top, bottom, left, right
what are the 4 components of “the cascade”?
source order, inheritance, specificity & !important
what does the term ‘source order’ mean with respect to css?
the order in which css rules are written. last styling for an element will take effect