CSS Flashcards
(28 cards)
Names of the CSS rule pieces:
- Selector
- Opening/ closing braces
- Properties
- Property values
How do you select elements by their class attribute?
You place a .class in the selector
How do you select elements by type
you place the element type in the selector position
how do you select an element by it’s ID?
Use #idName
Name three types of values to specify colors:
hex numbers, rgba, and specific color names
What CSS properties make up the box model?
Margin, borders, padding, content size. width height
Which CSS property pushes boxes away from each other?
margin.
Which CSS property adds space between a box’s content and it’s border?
padding.
What is a psuedo-class?
A psuedo-class is a keyword added to a selector that specifies a special state of the selected element.
psuedo-class used for?
It’s helpful for making elements on your page respond to interaction
Name two units of font size:
em, rem, px.
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?
div elements are block elements that do not share lines
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?
it does not interrupt flow but the element remains in the flow
How does setting position: relative on an element affect where it appears on the page?
It appears relative to its original static position.
How does setting position: absolute on an element affect document flow?
It removes it from the flow and places it in an exact position.
How does setting position: absolute on an element affect where it appears on the page?
It will place an element exactly where you want it, regardless of whether it clashes with other elements.
How do you constrain an absolutely positioned element to a containing block?
the nearest non static ancestor element will contain and absolute element. Create a block with relative positioning and it will serve as a container.
What are the four box offset properties?
top, bottom, left, and right
What are the four components of “the Cascade”.
Importance, specificity, source order, proximity