CSS Flashcards
What are the names of the individual pieces of a CSS rule?
Selector, declaration, property, value
In CSS, how do you select elements by theirclassattribute?
Period, class name
In CSS, how do you select elements by their type?
Element name
In CSS, how do you select an element by itsidattribute?
Hashtag, class name
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?
Width, height, padding, border, margin
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?
Keyword added to a selector that specifies a special state of the selected element
What are CSS pseudo-classes useful for?
Applying a style to an element in relation to the content of the document tree and to external factors i.e. history of navigator, status of content or position of mouse
Name two types of units that can be used to adjust font-size in CSS
Pixels, EMs, percentages
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?
Div is a block element with a default width of 100%, placing another div naturally goes under the other to take up its’ own width of 100%
What is the defaultflex-directionof an element withdisplay: flex?
Row
What is thedefaultvalue for thepositionproperty of HTML elements?
Static
How does settingposition: relativeon an element affect document flow?
Does not change document flow
How does setting position: relative on an element affect where it appears on the page?
Stays in the same spot
How does settingposition: absoluteon an element affect document flow?
Takes the element out of document flow
How does settingposition: absoluteon an element affect where it appears on the page?
Sits in the top left corner of its ancestor element
How do you constrain an absolutely positioned element to a containing block?
Setting a containing blocks position to anything but static
What are the four box offset properties?
Top, left, bottom, right
What does the transform property do?
Lets you rotate, scale, skew, or translate an element.