CSS Flashcards
What are the names of the individual pieces of a CSS rule?
- Selector (element, class or id)
- Declaration Block
- Property & Value (declaration)
In CSS, how do you select elements by their class attribute?
.classname{ }
In CSS, how do you select elements by their type?
elementname { }
In CSS, how do you select an element by its id attribute?
idname { }
What CSS properties make up the box model?
- Border
- Padding
- Margin
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 class applied to an element by the browser in a certain situation
What are CSS pseudo-classes useful for?
To make the website stylistically dynamic based on user interaction
Name at least two units of type size in CSS.
- px
- %
- em - default font size from container
- rem - default font size from doc root
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?
flex-direction: row;
What is the default flex-wrap of a flex container?
flex-wrap: nowrap;
Which axis does the justify-content property apply to?
main-axis (default is x-axis)
Which axis does align-content property apply to?
cross-axis (default is y-axis)