CSS Flashcards
What are the names of the individual pieces of a CSS rule?
Selector and Declaration
Name three different types of values you can use to specify colors in CSS.
RGB Values, Hex Codes, Color Names
What CSS properties make up the box model?
border, margin, and padding
What is a pseudo-class?
A selector that attracts elements in special state such as hover or focus. It is something the browser does.
What are CSS pseudo-classes useful for?
Let us write less code for styling.
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?
horizontal
What is the default flex-wrap of a flex container?
nowrap, all items will try to fit on one line
Why do two div elements “vertically stack” on one another by default?
Because they 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 an element affect document flow?
It moves the item it was applied to, but doesn’t affect the rest of the document flow.
How does setting position: relative on an element affect where it appears on the page?
It makes the element get positioned relative to where it would be in the normal document flow.
How does setting position: absolute on an element affect document flow?
Surrounding elements ignore the space the absolute positioned element would have taken up. The absolute item no longer has a place in the document flow.