CSS Flashcards
What is the default value for the position property of HTML elements?
normal flow
How does setting position: relative on an element affect where it appears on the page?
Position of the element would now be relative to the original normal flow position
How does setting position: relative on an element affect document flow?
the space allotted for the original flow is maintained.
How does setting position: absolute on an element affect document flow?
the element is no longer part of the page
How does setting position: absolute on an element affect where it appears on the page?
it is positioned relative to the containing element
How do you constrain an absolutely positioned element to a containing block?
the containing block must be set to relative
Name three different types of values you can use to specify colors in CSS.
hex codes, RGB values, color names
What are the names of the individual pieces of a CSS rule?
css ruleset, css selector, declaration block, property-value pairs
In CSS, how do you select elements by their class attribute?
with a period eg .color
In CSS, how do you select elements by their type?
just list the element eg h1 {
In CSS, how do you select an element by its id attribute?
with a # eg #jonathan {
What CSS properties make up the box model?
Border
margin (distance between box and other object)
padding (space between the border of a box and any content created within it)
width
height
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 CSS pseudo-class is a keyword added to a selector that specifies a special state of the selected element(s).