CSS Flashcards
What are the names of the individual pieces of a CSS rule?
type of selector, curly brace for the declaration block, property name, and value inside of it.
In CSS, how do you select elements by their class attribute?
.class name {
In CSS, how do you select elements by their type?
input[type=attribute name] {
In CSS, how do you select an element by its id attribute?
name of id {
Name three different types of values you can use to specify colors in CSS.
RGB values, hex codes, and color names.
What CSS properties make up the box model?
Borders, margins, and paddings.
Which CSS property pushes boxes away from each other?
Margin. It is an invisible space around your box and this pushes other elements away from the box.
Which CSS property adds space between a box’s content and its border?
Padding. It is the space between the content of an element and the border of that same element.
What is a pseudo-class?
It provides a special state of the selected element to the specified selector.
What are CSS pseudo-classes useful for?
It’s useful when you want to give action to a specified selector, such as styling links or responding to users.
Name at least two units of type size in CSS.
Px (pixels), rem (root element).
What CSS property controls the font used for the text inside an element?
The font-family.
What is the default flex-direction of a flex container?
Row.
What is the default flex-wrap of a flex container?
Nowrap.
Why do two div elements “vertically stack” on one another by default?
Because they are block elements.