CSS Flashcards
What are the names of the individual pieces of a CSS rule?
selector: indicates which elements to apply styling to
declaration: includes properties and values; indicates how the element(s) should be styled
How do you select elements by their class attribute?
with a period;
Ex: .class
How do you select elements by their tag name?
Just use the name of the element’s tag.
How do you select an element by its id attribute
Use a #
Ex: #id
Name 3 different types of values you can use to specify colors in CSS.
rgb: values for red, green, blue expressed as numbers between 0 and 255
hex: represent values for red, green blue in hexidecimal code
color name: predetermined, limited
What CSS properties make up the box model?
Margin, padding, border
Which CSS property pushes boxes away from each other?
Margin
Which CSS property adds space between a box’s content and its border?
padding
What is a pseudo-class?
Keyword added to a selector that specifies a special state of the selected elements
example: :hover
What are CSS pseudo-classes useful for?
Gives the user feedback - helps them track where they’re at or what they’ve done on the site
Name two types of units that can be used to adjust font-size in CSS
px, percentages, and ems
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
What is the default flex-wrap of a flex container?
Nowrap –> all flex items will be on one line
Why do 2 div elements “vertically stack” on one another by default?
Because they’re block elements