CSS Flashcards
What are the names of the individual pieces of a CSS rule?
Selector {property : value;}
In CSS, how do you select elements by their class attribute?
use a . in front of the element
In CSS, how do you select elements by their type?
in styles.css
h1 {
}
In CSS, how do you select an element by its id attribute?
use a # in front of the element.
Name three different types of values you can use to specify colors in CSS.
RGB Value
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 controls the gap between boxes.
Which CSS property add space between a box’s content and its border?
Padding specifies how much space is between the contents of an element and its border.
What is a pseudo-class?
allow you to change the style or appearance of elements when you interact with them.
What are CSS pseudo-classes useful for?
one example is knowing what links you’ve visited by changing the link color from blue to purple once it’s been clicked.
Name two types of units that can be used to adjust font-size in CSS.
rem
ems
px
percentage
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 - left to right
What is the default flex-wrap of a flex container?
nowrap - all flex items will be on one line.
Why do two div elements “vertically stack” on one another by default?
div elements are block level elements.