CSS Flashcards
What are the names of the individual pieces of a CSS rule?
A CSS rule is made up of a Selector, Property, and Value (property and value stored in key-value pairs within the declaration block)
In CSS, how do you select elements by their class
attribute?
.classname
denoted with a period
In CSS, how do you select elements by their tag name?
elementname
example:
h1 { font-size: 24px; }
In CSS, how do you select an element by its id
attribute?
#idname
denoted with a hashtage (#)
example:
#language { color: red; }
Name three different types of values you can use to set color in CSS
Keywords (Color name)
Hex Codes
RGB
RGBA
HSL
HSLA
What CSS properties make up the box model?
Margin, Border, Padding, Height, Width
refers to how HTML elements are modeled in browser engines and how the dimensions of those HTML elements are derived from CSS properties
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 and what is it useful for?
a selector that specifies a special state of the selected element(s)
a class that cannot be forced but must be achieved with a special state (ex. user interaction)
Name two types of units that can be used to adjust font-size
in CSS.
em, ch, ex, cm, rem
preferred: 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?
row (left-to-right)
What is the default flex-wrap
of a flex container?
nowrap
What are the three primary components of a page layout?
Container, Row, and Column
What is the minimum number of columns that you should put in a row?
At least one, even if that column takes up the full space