CSS Flashcards
What are the names of the individual pieces of a CSS rule?
selector, declaration, curly brace, property, value
How do you select elements by their class attribute?
by adding a period in front:
.example {}
How do you select elements by their tag name?
just add the tag name
example {}
How do you select an element by its id attribute?
by adding a # in front:
#example {}
Name three different types of values you can use to specify colors in CSS.
the color name, rgb values, hexcodes
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?
pseudo-classes are keywords added next the the selector that specifies a special state of the selected element.
Give an example of a pseudo-class
button : hover {
background-color: blue;
}
this would change the color of the button if your cursor hovers over it.
:hover :active :focus are a few other ones
What are CSS pseudo-classes useful for?
it helps change an element when a specific action is taken
What does the :nth-child() pseudo class do?
an :nth-child() pseudo-class is used to specify between a group of siblings using their positions
Name the types of units that can be used to adjust font-size in CSS.
pixels(px), percentages, and ems(em)/rem
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