CSS Flashcards
What are the names of the individual pieces of a CSS rule?
There are selectors, properties, and values (which is the declaration block) and all together it is known as a CSS rule set.
In CSS, how do you select elements by their class attribute?
Using a “ . “ and then the value of the attribute, followed by a declaration block.
In CSS, how do you select elements by their type?
Using the given node name, followed by a declaration block.
In CSS, how do you select an element by its id attribute?
Using a “#” and then the value of the attribute, followed by a declaration block.
Name three different types of values you can use to specify colors in CSS.
RGB (red, green, blue) values, hex codes, and color names
What CSS properties make up the box model?
padding, border, margin, height, width
Which CSS property pushes boxes away from each other?
Margin controls the gap between boxes.
Which CSS property add space between a box’s content and its border?
The padding property allows you to specify how much space should appear between the content and its border.
What is a pseudo-class?
It is a keyword that can be added to a selector to change the appearance of an element with a specific action like :hover, :active, :focus.
What are CSS pseudo-classes useful for?
Useful for event-based styling and …
Name at least two units of type size in CSS.
Pixels, percentages, EMs
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?
It is from left to right.
What is the default flex-wrap of a flex container?
All flex items will be on one line. Its value is “nowrap”.
Why do two div elements “vertically stack” on one another by default?
Because they are block level elements.