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 the default flex-direction of a flex container?
row
what is the default flex-wrap of a flex container
nowrap
what are the names of the individual pieces of a CSS rule?
selectors
in CSS, how do you select elements by their class attribute?
dot followed by the class name
in CSS, how do you select elements by their type?
type selector
in CSS, how do you select an element by its id attribute?
pound sign followed by the id name
name three different types of values you can use to specify colors in CSS
hex, rgb, color keywords
what is a pseudo-class?
noted by a colons to allow extra functionality to certain css selectors
what are CSS pseudo-classes useful for?
hover, visited, etc elements, i.e., a different color for a hovered anchor tag, a set color for a visited anchored tag to indicated its been clicked
name at least two units of type size in CSS
px, rem, em
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?
sets as a division of content; vertically (one below the other continuously) is default
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 (each block-level element sits on top of the next one)
how does setting position: relative on an element affect document flow?
moves an element in relation to where it would have been in normal flow (i.e., top, left, bottom, right, in pixels, percentages, or ems)
how does setting position: relative on an element affect where it appears on the page?
box is taken out of normal flow and no longer affects the position of other elements on the page; relative does no changes to element if you dont define the offset properties
how does setting position: absolute on an element affect document flow?
acts like it is not there
How does setting position: absolute on an element affect where it appears on the page?
not static; persistent; doesn’t affect it’s surrounding but overrides them; acts as 1 z-index above the other content (?)
How do you constrain an absolutely positioned element to a containing block?
position relative; edit padding based on nearest ancestor block