CSS Flashcards
What are the names of the individual pieces of a CSS rule?
Selector and Declaration block
Property and value
In CSS, how do you select elements by their class attribute?
Using a . followed by name of the class
In CSS, how do you select elements by their tag name?
Writing out the name of the element
In CSS, how do you select an element by its id attribute?
Using a # followed by the name of the id
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 a pseudo-class?
A keyword added to a selector that specifies a special state of the selected element(s).
Just a class.
What are CSS pseudo-classes useful for?
Lets you apply a style of element in relation to the content as well as external factors
We use it because it’s easier to adjust and modify the code
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?
They are blocks by default
What is the default flex-direction of an element with display: flex?
Row
What are the three primary components of a page layout? (Which helper classes do you need?)
Container, Row, Columns
What is the minimum number of columns that you should put in a row?
At least one
What is the purpose of a container?
The boundary to contain all your elements
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 has no effect on document flow
How does setting position: relative on an element affect where it appears on the page?
It is put relative to where it would normally be.
Ex. Out of body experience
How does setting position: absolute on an element affect document flow?
It is taken out of the normal flow and no longer affects the position of other elements
Element no longer exists
How does setting position: absolute on an element affect where it appears on the page?
It is bounded by the nearest non static ancestor
How do you constrain an absolutely positioned element to a containing block?
What are the four box offset properties?
Top, Bottom, Left, Right