CSS Flashcards
What are the names of the individual pieces of a CSS rule?
Selectors and Declarations
Property and Value
In CSS, how do you select elements by their class attribute?
You put a period . in front of the class attribute value
.class-name
In CSS, how do you select elements by their type?
You put whatever element type is followed by curly braces
p {} h1 {} h2 {} div {} em {} span {}
In CSS, how do you select an element by its id attribute?
id-name
You put a pound symbol # in front of the id attribute value
Name three different types of values you can use to specify colors in CSS.
RGB Value, Hex Codes, Color Names
What CSS properties make up the box model?
border, margin, and padding
Which CSS property pushes boxes away from each other?
margin
Which CSS property adds 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(s)
Pseudo-classes only apply when the element is in a certain state
What are CSS pseudo-classes useful for?
Webpage interaction
Pseudo-classes allow us to write less code
Name at least two units of type size in CSS.
Em, pixels, and percentages
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?
The default direction is row - from left to right
What is the default flex-wrap of a flex container?
No-wrap is the default which makes all the items try to fit on one line
Wrap allows the content to be displayed on multiple lines from top to bottom
Why do two div elements “vertically stack” on one another by default?
They are block elements so they begin on a new line