CSS Flashcards
What are the names of the individual pieces of a CSS rule?
CSS declaration sits inside a curly bracket with two parts: a property and a value which are separated by a colon.
In CSS, how do you select elements by their class attribute?
Use . before the name of the class (.class)
In CSS, how do you select elements by their type?
Use the name of the element (h1, h2, h3)
In CSS, how do you select an element by its id attribute?
Use # before the name of the id (#id)
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?
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.
What are CSS pseudo-classes useful for?
Lets you apply a style to an element in relation to external factors, the status of the content, or the position of the mouse. Helps reduce the amount of code to write for the same result.
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 is the default, all flex items will be on one line.