CSS Flashcards
What are the names of the individual pieces of a CSS rule?
A CSS rule consists of a selector, an opening curly bracket for the declaration block, properties and their associated values, and the closing curly bracket for the declaration bracket.
In CSS, how do you select elements by their class attribute?
To select a class, you need to use a . character in front of the name of the class.
In CSS, how do you select elements by their type?
To select a particular type, you simply write the type name followed by the declaration block.
In CSS, how do you select an element by its id attribute?
To select an element but its id attribute, you need to use a # character in front of the name of the id.
Name three different types of values you can use to specify colors in CSS.
color, background-color, border-color
What CSS properties make up the box model?
margins, border, padding, and the content inside the box.
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?
The pseduo-class is a character (:keyword) that is added to a selector that specifies a special state of the selected element.
What are CSS pseudo-classes useful for?
It allows you to stylize an element that has a focus placed upon it. Such as hovering over or clicking on an element.
Name two types of units that can be used to adjust font-size in CSS.
px, em
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?
Horizontal
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?
They vertically stack due to being block-level elements.