CSS Flashcards
What are the names of the individual pieces of a CSS rule?
selector { property: value; }
the property-value pairs are called declarations
the curly braces and their contents are called the declaration block
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?
elementId { … }
Name three different types of values you can use to specify colors in CSS.
RGB values, hex codes, color names
Name at least two units of type size in CSS.
Pixels, percentages, em, rem…
What CSS property controls the font used for the text inside an element?
font-family
What is a pseudo-class?
A selector that selects for the state an element is in {ie. active, focus, hover, visited)
What are CSS pseudo-classes useful for?
Allow you to apply styles based on user events (like click, hover, visited link) and based on an element’s relation to other elements
What CSS properties make up the box model?
padding, border, margin
Content is also a part of the box model but it’s not a property.
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 the default flex-direction of a flex container?
row
What is the default flex-wrap of a flex container?
nowrap
What are the four components of “the CSS Cascade”.
- source order
- inheritance
- specificity
- !important