CSS Flashcards
What are the names of the individual pieces of a CSS rule?
p {
font-family: Arial;
}
p = selector
font-family: Arial; = declaration
font-family: = property
Arial = value
In CSS, how do you select elements by their class attribute?
.class-name { }
In CSS, how do you select elements by their type?
p { }
In CSS, how do you select an element by its id attribute?
ID-name{ }
Name three different types of values you can use to specify colors in CSS.
RGB Values
Hexadecimal Codes
Color Names
What CSS properties make up the box model?
Margin
Border
Padding
Content
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 way to select an element when its in a given state
Exp: being hovered
Currently being clicked on
What are CSS pseudo-classes useful for?
They let you apply different styling to elements when those elements are in their given states
Name at least two units of type size in CSS.
px
rem
em
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 (everything goes in one line)
What is the default value for the position property of HTML elements?
Every element is status by default