CSS Flashcards
What are the names of the individual pieces of a CSS rule?
A CSS rule contains two parts: a selector and a declaration.
In CSS, how do you select elements by their class attribute?
To select elements with a specific class, write a period (.) character, followed by the name of the class.
In CSS, how do you select elements by their type?
The CSS type selector matches elements by node name. In other words, it selects all elements of the given type within a document.
In CSS, how do you select an element by its id attribute?
To select an element with a specific id, write a hash (#) character, followed by the id of the element.
Name three different types of values you can use to specify colors in CSS.
In CSS, colors can be specified by using hexadecimal values, color names, and rBGA values.
What CSS properties make up the box model?
The CSS properties that make up the box model are; padding, border, and margin.
Which CSS property pushes boxes away from each other?
The CSS property that pushes boxes away from each other is margin.
Which CSS property add space between a box’s content and its border?
The CSS property that adds space between a box’s content and its border is 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).
What are CSS pseudo-classes useful for?
Pseudo-classes let you apply a style to an element in relation to the content of the document tree, and; external factors like the history of the navigator, the status of its content, or the position of the mouse.
Name at least two units of type size in CSS.
In CSS, em and ex are examples of units of type size for text font.
What CSS property controls the font used for the text inside an element?
The CSS property that controls the font used for the text inside an element is called font-family.
What is the default flex-direction of a flex container?
The default flex-direction of a flex container is row.
What is the default flex-wrap of a flex container?
The default flex-wrap of a flex container is no wrap.
Why do two div elements “vertically stack” on one another by default?
Two div elements “vertically stack” on one another by default because a div is a block-level element.