CSS Flashcards
what are the individual pieces of a css rule?
css selector (element, class, id, etc), declaration block; within declaration block is property and value
how to select elements by their class attribute?
.class-name {}
how to select elements by their type?
element-name {}
How to select elements by their id?
id-name{}
Three different types of values to choose color in CSS
hexcode, rgb(), hsla, prebaked css color
how do you link a css stylesheet to an index html?
link href=”location-of-stylesheet.css” rel=”stylesheet” type=”text/css”
What is a descendant combinator selector and how do you use it?
selects all elements that are descendants of the first element.
parent-element “ [single space] “ child-element {}
What is a child combinator selector and how do you use it?
only uses direct children of the parent element.
parent-element > child-element {}
what css properties make up the box model?
margin, padding, border
which css property pushes boxes away from each other?
margin
what css property adds space between a box’s content and its border?
padding
what is a pseudo class?
a selector that targets an element in a certain state (being hovered, active, focus)
what are pseudo-classes useful for?
for selecting targets in a certain state and applying additional properties (e.g. changing the color of a button when hovered)
2 types of units that can be used to adjust font-size
rem, em , px size
what css property controls font used for text?
font-family
What is a fall-back value for fonts?
backup font a browser typically has in case that browser or program does not have that font initially specified (typically serif/sans-serif)