CSS Flashcards
What are the names of the individual pieces of a CSS rule?
selector and declaration block- within block is a property assigned a value (separated by semicolon)
ex) p {color:red}
In CSS, how do you select elements by their class attribute?
class attribute is .classname
In CSS, how do you select elements by their type?
element name ex) h1, h2, body, p
In CSS, how do you select an element by its id attribute?
id attribute is #idname
Name three different types of values you can use to specify colors in CSS.
Hex code, rgb vaules, color names
What CSS properties make up the box model?
margin, padding, border, content
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?
classes applied by the browser under certain conditions [keyword added to a selector for when a special event occurs (hover, focus, active)]
What are CSS pseudo-classes useful for?
apply style, user interaction
Name at least two units of type size in CSS.
px, 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
What is the default flex-wrap of a flex container?
no wrap
Why do two div elements “vertically stack” on one another by default?
because they are block elements