CSS Flashcards
What are the names of the individual pieces of a CSS rule-set?
Declaration block
Selector
Property:value pairs
In CSS, how do you select elements by their class attribute?
.class
In CSS, how do you select an element by its ID attribute?
idname
Name 3 different type values you can use to specify colors in CSS:
rgb
rgba
hex
hsl
What CSS properties make up the box model?
height width padding border margin
Which CSS property pushes boxes away from each other?
margin
What CSS property adds space between the content of a box and its border?
padding
What is a pseudo class?
A keyword added to a selector that specifies a specific state of the selected element(s).
What are CSS pseudo classes useful for?
They allow developers to style elements when the user is interacting with the elements differently than when the user is not interacting with them.
What is a fall back value?
With font-family we use a fall back value along with the value in case the browser doesn’t have the first value available.
Name two types of units that can be used to adjust font-size in CSS?
px
em
what css property controls the font used for the text inside an element?
font-family
What is the default flex-direction of the flex container?
row
what is the default flex-wrap of the flex container?
nowrap
Why do two div elements vertically stack on one another by default?
Div elements are block-level 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?
Normal flow
How does setting position: relative on an element affect document flow?
This moves an html element from its normal flow position and shifts it up/down/left/right.
However, it doesn’t affect elements surrounding it in the flow of the document
How does setting position: relative on an element affect where it appears on the page?
It shifts the element without disrupting the surrounding elements. So it moves it within its parent container essentially.
How does setting position: absolute on an element affect document flow?
It does not affect the normal flow of the document as elements essentially act as though the element is not there.
How does setting position: absolute on an element affect where it appears on the page?
It allows an element to be positioned in relation to its containing element rather than the other elements within the container.
How do you constrain an absolutely positioned element to a containing block?
set the element you want your element inside of to position: relative or absolute and not static
What are the four box offset properties?
top
bottom
right
left
What does the term “source order” mean with respect to CSS?
The further down in your style sheet the stronger the styling is considered