CSS Flashcards
body {
color: #090302;
font-family: sans-serif;
}
- CSS rule set
- body (selector) (CSS selector for the body element)
- opening curly brace for declaration block (block of declarations)
- color: #090302; (declaration)
- color (property)
- # 090302; (value)
shorthand property
multiple values
What are the names of the individual pieces of a CSS rule?
selector, declaration block, property, value
In CSS, how do you select elements by their class attribute?
.
In CSS, how do you select elements by their tag name?
element name
In CSS, how do you select an element by its id attribute?
#
Name three different types of values you can use to specify colors in CSS.
rgb, hsl, hcv, color keywords
rgb (244,249,251)
css function rgb with arguments 244 249 251
What CSS properties make up the box model?
It consists of: height, width, margins, borders, padding, and the actual content.
Which CSS property pushes boxes away from each other?
margin (puffy jacket, you’re same size)
Which CSS property add space between a box’s content and its border?
padding (weight you put on) (pee-pad)
What is a pseudo-class?
A CSS pseudo-class is a keyword added to a selector that specifies a special state of the selected element(s). For example, the pseudo-class :hover can be used to select a button when a user’s pointer hovers over the button and this selected button can then be styled.
What are CSS pseudo-classes useful for?
Pseudo-classes let you apply a style to an element not only in relation to the content of the document tree, but also in relation to external factors like the history of the navigator (:visited, for example), the status of its content (like :checked on certain form elements), or the position of the mouse (like :hover, which lets you know if the mouse is over an element or not).
Name two types of units that can be used to adjust font-size in CSS.
pixels, percentage, ems
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 - horizontal
What is the default flex-wrap of a flex container?
default flex-wrap: nowrap
Why do two div elements “vertically stack” on one another by default?
block element