CSS Flashcards
What are the names of the individual pieces of a CSS rule?
Property and value which are separated by a colon.
In CSS, how do you select elements by their class attribute?
Use a . before the name of the class attribute.
In CSS, how do you select elements by their type?
Use the name of the element.
In CSS, how do you select an element by its id attribute?
Use a # before the name of the id attribute.
Name three different types of values you can use to specify colors in CSS.
RGB values, hex codes, and pre determined color names.
What CSS properties make up the box model?
Margin, padding, border
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 to specify the special state of the selected element.
What are CSS pseudo-classes useful for?
To apply styling to elements based on html structure/grouping or user actions without the need for a class manually applied by the dev.
Name at least two units of type size in CSS.
rem/em, pixel, %
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 is the default direction
What is the default flex-wrap of a flex container?
nowrap is the default
Why do two div elements “vertically stack” on one another by default?
By default, div elements are block elements.