Box Model Flashcards
What is the general rule of using units?
font-size: rem
padding & margin: em
width: em or %
How does the browser calculate em?
It becomes relative to the font-size of current element, when used on anything other than font-size. Font-size is calculated relative the parent’s font-size.
How does the browser calculate rem?
The font size of the root element: or :root.
What is the best unit of width: for a responsive design?
%
What is the difference between content-box and border-box in box-sizing property?
Content-box makes 100px width set the content box of an element to 100px.
Border-box will include the border and padding in the 100px of the element.
What are the four areas of an element’s box model, from the inside out?
Content, padding, border and margin.