Responsive Web Design Flashcards
Terms for mobile first and the opposite?
Progressive Enhancement vs Graceful Degredation
Term for viewable area of the browser?
Viewport
what does max-width vs width property do for images
max-width says what percentage of the images native resolution it will be. Width defines what percentage of the container it is in it will take up
What should determine a site’s breakpoints?
the design elements of the site (not some pre-defined or standard pixel width)
what is the difference between REM and EM?
em is a size relative to the default font size (usually 16 px). REM stands for root-em and is also relative to the default font size. The difference is that em’s are also relative to the font size defined in their container (such that .75em inside of a container with .75em font size would be less than .75rem - it would be 75% of the container’s font size)
what are the four edges of a box in HTML?
- content box (innermost box)
- padding box (edge is inner edge of border)
- border box (edge is outer edge of border)
- margin box (edge is outer edge of border + margin)
Define content box and border box
content box - edges of container’s content
border box - outer edge of container’s border
Explain what happens when you set the position of an element to relative and then give one of it’s children position: absolute; ?
The interior element is contained within the relative outer element but can share the same space with the outer element
Name 5 things you can query for using @media queries?
- width
- height
- orientation
- resolution
- Aspect Ratio
Where should you write your media queries
Recommendation is to write them next to the default styling
How do you tell the browser to make the viewport the width of the device
in a meta tag with this name/value pair:
name=”viewport” content=”width=device-width”
How do you change styles when javascript is present (enabled)
You can make one of your first javascript functions be to change the class of elements from one which assumes no javascript (example: class=”no_js”) to one that assumes javascript is present (example: class=”jsWorking”). The class will only change when javascript is present.
What is the difference between block, inline-block, and inline?
- Block - occupies the whole line (and can have height in addition to contents)
- Inline - shares line with other elements (and can’t have height property - but can have line-height and margin)
- Inline-block - sort of a combination of the first two. blocks of content which can have height property but share the line with other elements
What are three types of Flexbox alignment?
justify-content - alignment along primary flexbox axis (horizontal when flex-direction is column)
align-items - alignment along secondary axis (vertical when flex-direction is row)
align-content - alignment of items when there is more than one row (or column) of items.
What aligns main Flexbox axis?
justify-content