CSS Flashcards
What are the names of the individual pieces of a CSS rule?
selector, declaration, inside the declaration block, there are properties and values.
In CSS, how do you select elements by their class attribute?
using the dot notation in front of the selector name.
In CSS, how do you select elements by their type?
using element name
In CSS, how do you select an element by its id attribute?
using hash notation in front of the selector name.
Name three different types of values you can use to specify colors in CSS.
RGB Values, Hex Codes, Color Names
What CSS properties make up the box model?
content, padding, border, margin
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?
a keyword added to a selector that specifies a special state of the selected element(s). classes applied by the browser under special circumstances.
What are CSS pseudo-classes useful for?
Pseudo-classes let you apply a style to an element under specific circumstances. apply styling as a result of user interaction.
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?
row
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 div is a block level element.
What is the default flex-direction of an element with display flex?
row
What is the default value for the position property of HTML elements?
static
How does setting position relative on an element affect document flow?
normal document flow, other neighboring elements will stay the same. once the positioned element has taken its place in the normal flow, you can then modify its final position, including making it overlap other elements on the page.