CSS Flashcards
What are the names of the individual pieces of a CSS rule?
The selector and the declaration block, which contains properties and property values.
In CSS, how do you select elements by their class attribute?
.class-name
In CSS, how do you select elements by their type?
Using just the element name, ex: h1, p, div
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, Hex Codes, and color names. -extra- HSL HSLA RGBA
What CSS properties make up the box model?
The content width and height, padding, border, margin.
Which CSS property pushes boxes away from each other?
Margins.
Note: Be aware of margin collapse where the larger top/bottom margin wins.
Which CSS property adds space between a box’s content and its border?
Padding
What is a pseudo-class?
It’s a keyword added to a selector that specifies a special state of the selected element(s)
What are CSS pseudo-classes useful for?
CSS pseudo-classes are used to add styles to selectors when those selectors meet certain conditions, whether that’s based on the content of the document tree, or on external factors, ex: position of the mouse (hover)
Name at least two units of type size in CSS.
Px and percentages
-extra-
ems, ex, and rem
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 flex-direction of a flex container is row.
What is the default flex-wrap of a flex container?
Nowrap
What is the default flex-direction of an element with display: flex?
Row