CSS day 2 & 3 Flashcards
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?
because 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?
The default position is static for any html element if not specified explicitly. static is always the initial value for the CSS property position no matter which tag.
How does setting position: relative on an element affect document flow?
Relative positioning moves an element in relation to where it would have been in normal flow.
How does setting position: relative on an element affect where it appears on the page?
This moves an element from the position it would be in normal flow, shifting it to the top, right, bottom, or left of where it would have been placed.
How does setting position: absolute on an element affect document flow?
When the position property is given a value of absolute, the box is taken out of normal flow and no longer affects the position of other elements on the page. (They act like it is not there.)
How does setting position: absolute on an element affect where it appears on the page?
This positions the element in relation to its containing
element.
How do you constrain an absolutely positioned element to a containing block?
absolute, relative, and fixed. (anything other than static)
What are the four box offset properties?
top, bottom, left, right
What are the four components of “the Cascade”.
Source order, Inheritance, Specificity, Important
What does the term “source order” mean with respect to CSS?
The order that your CSS rules are written in your stylesheet. The styling provided for an element last in your stylesheet is the styling that will ultimately take effect.
How is it possible for the styles of an element to be applied to its children as well without an additional CSS rule?
due to CSS Inheritance. When no value for an inherited property has been specified on an element, the element gets the computed value of that property on its parent element.
List the three selector types in order of increasing specificity.
Type selectors, Class, selectors, ID selectors.