CSS Flashcards
What are the names of the individual pieces of a CSS rule?
Selector, Declaration Block, Properties, Values (all together they are called a “rule set”)
In CSS, how do you select elements by theirclassattribute?
.classname
In CSS, how do you select elements by their type?
the element name
In CSS, how do you select an element by itsidattribute?
#
Name three different types of values you can use to specify colors in CSS.
RBG values, Hex codes, Color Names
What CSS properties make up the box model?
Padding, Margin, Border, Width and Height
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 CSS pseudo-class is a keyword added to a selector that specifies a special state of the selected element(s). For example, :hover can be used to change a button’s color when the user’s pointer hovers over it.
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 adjustfont-sizein CSS.
px, em, %
What CSS property controls the font used for the text inside an element?
font-family
What is the defaultflex-directionof aflexcontainer?
Row
What is the defaultflex-wrapof aflexcontainer?
no-wrap
Why do two div elements “vertically stack” on one another by default?
They are Block elements