CSS Flashcards
(36 cards)
What are the names of the individual pieces of a CSS rule?
selector; declaration with a property and value
In CSS, how do you select elements by their class attribute?
.classname
In CSS, how do you select elements by their type?
match element name
In CSS, how do you select an element by its id attribute?
idname
Three different types of values used to specify colors in CSS
RBG values, hex codes, color names
What CSS properties make up the box model?
border, margin, padding, height, width
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 class applied by a browser that specifies a special state of the selected element
What are pseudo classes useful for?
applying style to an element in relation to external factors or events made by the user
Two types of units that can be used to adjust font-size in CSS
px, rem
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 (left to right)
What is the default flex-wrap of a flex container?
nowrap (all flex items are on one line)
Why do two div elements “vertically stack” on one another by default?
div elements are block elements
What is the default flex-direction of an element with display: flex?
row (left to right)
What is the default value for the position property of HTML elements?
static
How does setting position: relative on an element affect document flow?
it stays the same
How does setting position: relative on an element affect where it appears on the page?
it stays the same
How does setting position: absolute on an element affect document flow?
it gets removed from the document flow
How does setting position: absolute on an element affect where it appears on the page?
it gets positioned against non-static elements
How do you constrain an absolutely positioned element to a containing block?
set property as not static
What are the four box offset properties?
top, bottom, left, right
What are the four components of “the Cascade?”
- source order
- inheritance
- specificity
- !important