CSS Flashcards
What are the names of the individual pieces of a CSS rule?
the selector
opening bracket of the declaration block
properties: values;
closing bracket of the declaration block
In CSS, how do you select elements by their class attribute?
You select elements by their class attribute with a .classname
In CSS, how do you select elements by their type?
You select elements by their type by using their name
In CSS, how do you select an element by its id attribute?
You select elements by its ID attribute with a #idName
Name three different types of values you can use to specify colors in CSS
hexcode
RGB(red, green, blue)
color presets
What CSS properties make up the box model?
margins
borders
padding
width and height
the content within the box
Which CSS property pushes boxes away from each other?
The margin property
Which CSS property adds space between a box’s content and its border?
The padding property
If two boxes sit on top of one another, what happens?
The border of the boxes collapse. The margin will be the larger of the two boxes.
What is a pseudo class?
They are classes appended to elements in CSS that makes the elements behave differently when interacted with.
What are CSS pseudo classes useful for?
They’re useful for making a page feel more interactive.
What order must pseudo classes be in?
:link, :visited, :hover, :focus, :active
Name two types of units that can be used to adjust font-size in CSS
rem
pixels (px)
ems
percentages
What CSS property controls the font used for the text inside of an element?
font-family
Which property adds emphasis to text? What two values can it have?
font-weight
normal, bold
Which property can make font either normal, italic, or oblique?
font-style
What is the default size of text in browsers?
16px
What is the default flex-direction for a flex container?
The default flex-direction is “row”
What is the default flex-wrap of a flex container?
The default flex-wrap is “nowrap”
Why do two div elements “vertically stack” on one another by default?
Because div elements are block elements.
What is the default flex-direction of an element with display: flex?
The default flex-direction of an element with display: flex is “row”
How do you enable flex context for an elements children?
You give their parent (container) a display property with a value of “flex”
display: flex;
What does flex-direction do?
It establishes the main-axis, defining the direction that flex items are placed within their container.
What does flex-wrap do?
Flex-wrap makes flex items begin on a new line after taking up all of the available horizontal space