CSS Positioning Flashcards
Any element that comes in as a block will automatically take up what size?
The full width of the page
What does inline-block value do?
Allows you to put several block elements on the same line.
What is the margin?
The space around the element
What happens when an element is set to position:absolute
It’s positioned in relation to the first parent element it has that DOESNT have position:static
What does the inline value do?
The inline value places all your elements next to one another, but not as blocks: they don’t keep their dimensions.
What is the border?
The edge of the element
What happens if there’s no such element with position:absolute
It’s positioned relative to
What is the inline display value best suited for?
HTML elements that are blocks by default, such as headers and paragraphs.
What is the padding?
The spacing between the border and the innermost layer: the actual conent
What does relative positioning do?
It tells the element to move relative to where it would have landed if it just had the default static positioning
What does the none display value do?
this prevents the page from displaying the selected element. As you might not expect, this removes the selected element from the page entirely, including any children and any content.
What is the content
The stuff in the box
What does fixed positioning do?
“glues an element to the screen”
Test Question
Test Answer
How do you set an element’s margin all at once
Start from the top margin and go around clockwise (going from top to right to bottom to left).
What does the clear property do?
Specifies which sides of an element where other floating elements are not allowed
What happens when you tell an element to clear left?
it will immediately move below any floating elements on the left side of the page; it can also clear elements on the right. If you tell it to clear: both, it will get out of the way of elements floating on the left and right!
What does the float property do?
The float property specifies whether or not a box (an element) should float.
What happens when you don’t specify an element’s positioning type
It defaults to static
What is the z-index property?
The z-index property specifies the stack order of an element