CSS Flashcards
What are the names of the individual pieces of a CSS rule?
A ruleset has a selector and a declaration block
A declaration block consists of at least 1 declaration
A declaration is one property and one value
In CSS, how do you select elements by their class attribute?
“.className”
In CSS, how do you select elements by their type?
Just state it
In CSS, how do you select an element by its id attribute?
“#elementId”
Name 3 different types of values you can use to specify colors in CSS.
- hexadecimals
- colors
- RGB
What CSS properties make up the box model?
- margin
- border
- padding
What 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?
Keyword added to CSS selectors to target elements under certain states
What are CSS pseudo-classes useful for?
Helps with responding to users, making the page feel more interactive
Name 2 types of units that can be used to adjust font-size in CSS.
- px
- em
What CSS property controls the font used for the text inside the element?
Font-family
What is the default flex-direction of a flex container?
Row, which means items will be arranged horizontally from left to right
What is the default flex-wrap of a flex container?
No-wrap, which means all items will fit on one line
Why do two div elements “vertically stack” on one another by default?
Div elements are block elements