CSS Flashcards
What are the names of the individual pieces of a CSS rule?
the selector, the declaration of the code block, and then the properties and its values.
In CSS, how do you select elements by their class attribute?
.class-name
In CSS, how do you select elements by their type?
just write their name so ex: h1, body, etc.
In CSS, how do you select an element by its id attribute?
id-name
Name three different types of values you can use to specify colors in CSS.
You can use color (name of color), the function rgb (numbers), and hex codes(#).
*HSL, HSLA and RGBA are other ways.
What CSS properties make up the box model?
Height, width, padding, border, and margin
Which CSS property pushes boxes away from each other?
Margin. It is OUTSIDE the border element
*Margin is wearing a puffy jacket
Which CSS property add space between a box’s content and its border?
Padding. It is INSIDE the border element
*Padding is gaining weight
What is a pseudo-class?
A keyword that specifies a special state of a selected element.
What are CSS pseudo-classes useful for?
They’re useful for applying a style in relation to the user or their cursor.
Name two types of units that can be used to adjust font-size in CSS.
Px, %, rem, and em
TIP: Best to use “em” for device flexibility
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?
flex-direction: row;
What is the default flex-wrap of a flex container?
flex-wrap: nowrap;
Why do two div elements “vertically stack” on one another by default?
They are block level elements, so they take up the full width of the page and push other elements down.