CSS Flashcards
What are the names of the individual pieces of a CSS rule?
Selector, declaration block (property, value)
In CSS, how do you select elements by their class attribute?
.className
In CSS, how do you select elements by their type?
element name
In CSS, how do you select an element by its id attribute?
idName
Name three different types of values you can use to specify colors in CSS.
RGB Values, Hex Code, Color Name
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?
Classes applied by the browser in certain circumstances.
What are CSS pseudo-classes useful for?
Adding style to an element based on user behavior.
Name at least two units of type size in CSS.
Rem, Em, Px, %
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?
No-wrap
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?
Static
How does setting position: relative on an element affect document flow?
It does not
How does setting position: relative on an element affect where it appears on the page?
Starts at original position and shifts to top, bottom, left, or right of where it would have been placed.
How does setting position: absolute on an element affect document flow?
Gets removed from document flow
How does setting position: absolute on an element affect where it appears on the page?
Goes to first non static element.
How do you constrain an absolutely positioned element to a containing block?
set the ancestor element that the absolute element should use as its boundary to a non-static position value
What are the four box offset properties?
Top, bottom, left, right.
What are the four components of “the Cascade”.
Source Order, Inheritance, Specificity, and !Important.