CSS Flashcards
What are the names of the individual pieces of a CSS rule?
Selector, declaration block, properties with values
In CSS, how do you select elements by their class attribute?
.name{}
In CSS, how do you select elements by their type?
Just-the-name{}
In CSS, how do you select an element by its id attribute?
name{}
Name three different types of values you can use to specify colors in CSS.
Rgb, hex, color names, hsl
What CSS properties make up the box model?
Margin, Border, Padding, Content
Which CSS property pushes boxes away from each other?
Margin
Which CSS property adds space between a box’s content and its border?
Padding
What is a pseudo-class?
A pseudo-class is used to define a special state of an element.
For example, it can be used to:
- Style an element when a user mouses over it
- Style visited and unvisited links differently
- Style an element when it gets focus
What are CSS pseudo-classes useful for?
Allow us to add more functionality on a webpage without using javascript.
For example, it can be used to:
- Style an element when a user mouses over it
- Style visited and unvisited links differently
- Style an element when it gets focus
Name at least two units of type size in CSS.
Pixel, rem, em, ch
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 (horizontal direction)
What is the default flex-wrap of a flex container?
No wrap
Why do two div elements “vertically stack” on one another by default?
Because they are block level