CSS Flashcards
What are the names of the individual pieces of a CSS rule?
Selector, declaration
In CSS, how do you select elements by their class attribute?
.element[attribute]
In CSS, how do you select elements by their type?
selector type
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
Hex, name, RGB
What CSS properties make up the box model?
padding, border, margin
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?
A keyword added to a selector that specifies a state of the element
What are css pseudo-classes useful for?
They can apply style to different states of an element. For example, if a link has been visited, it can be changed color to indicate that its been clicked before.
Name at least 2 units of type size in CSS
em, 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?
They are block elements and block elements start on new lines