CSS Flashcards
- What are the names of the individual pieces of a CSS rule?
a rule set consists of a selector, the declaration, and inside the declaration goes the property and the given value
In CSS, how do you select elements by theirclassattribute?
.class
- In CSS, how do you select elements by their type?
state the element type
- In CSS, how do you select an element by itsidattribute?
id
Name three different types of values you can use to specify colors in CSS.
RGB, Hex Code, Color
- What CSS properties make up the box model?
margin, padding, border, 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?
is a kind of class that is executed by the browser when an action is performed, hovered, submit, click, etc
- What are CSS pseudo-classes useful for?
they are useful when trying to change the appearance of elements when user interacts with them
- Name two types of units that can be used to adjustfont-sizein CSS.
pixels, percentage, or rem
- What CSS property controls the font used for the text inside an element?
font-family
- What is the defaultflex-directionof aflexcontainer?
row, left to right
- What is the defaultflex-wrapof aflexcontainer?
all on one line AKA nowrap
- Why do two div elements “vertically stack” on one another by default?
because div elements are block elements so they take up all available space
- What is the defaultflex-directionof an element withdisplay: flex?
row left to right
- What is thedefaultvalue for thepositionproperty of HTML elements?
static
- How does settingposition: relativeon an element affect document flow?
it doesn’t change document flow
- How does settingposition: relativeon an element affect where it appears on the page?
relative to original position, changes according box offset
- How does settingposition: absoluteon an element affect document flow?
no longer part of document flow
- How does settingposition: absoluteon an element affect where it appears on the page?
it stays put in absolute position regardless, viewfinder may increase or decrease but position will stay
- How do you constrain an absolutely positioned element to a containing block?
you have to set parent div to relative position
- What are the four box offset properties?
top, right, bottom, left
Give two examples of media features that you can query in an @media rule.
min-width & max-width