Responsive Design Flashcards

1
Q

What does the viewport do?

A

defines the area of the screen the browser can render content to

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What are DIPs

A

Device
Independent
Pixels

Number of pixels relating to a real distance, regardless of the pixel density on the screen

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What does the browser do if the viewport is not set?

A

It will size the viewport to be 980px (dips) wide

it will also do something called font boosting. font boosting is when a browser tries to pick which elements on the page are important and then scales them up

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What is the device pixel ratio?

A

With one dip for every n amount of hardware pixels

With one dip for every two hardware pixels, the device pixel ratio is 2!

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

describe each line

A

A viewport element gives the browser instructions on how to control the page’s dimensions and scaling.

The width=device-width part sets the width of the page to follow the screen-width of the device (which will vary depending on the device).

The initial-scale=1.0 part sets the initial zoom level when the page is first loaded by the browser. 1 means that we are instructing the browser to have a 1 to 1 relationship between device independent pixels and css pixels

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

How would you prevent video, object, img, and embed content from spreading wider than the container?

A

img, object, video, embed {
max-width: 100%;
}

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

how should you set your “tap targets” on you page using css?

tap targets can be a, nav, button

A

nav, a, button{
min-width: 48px;
min-height: 48px;
}

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What is the difference between implementing media queries through a linked css style sheets versus @media requests in the same style sheet?

A

Linked CSS
many small http requests

@media
few big http requests

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What is the difference between media queries with min-width versus min-device-width

A

min-width
based on the browser window

min-device-width
based on the size of the screen

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

How would you write a media query that turns the background red at 400px and below?

A
@media screen and (max-width: 400px) {
        body {
			background-color: red;
			}
      }
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

How would you apply styles between 301px and 600px using media queries

A

@media screen and (min-width:301px) and (max-width: 600px){…}

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

About how many characters per line of text should you aim for?

A

65cpl

characters per line

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What is the a good place to start for font-size and line-height for font?

A

font-size:16px;

line-height:1.2em;

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

How would you give two images side by side with 50% width a 10px margin between them?

A

img{
width: calc((100%-10px)/2)
}

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

raster vs vector images

A

raster
images represented a grid with dots of color
canvas element, photo

vector
made up of curves, lines, fill colors, shapes, and gradients
svg
svg makes it possible for responsive vector graphics

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

What is the advantage of vector over raster?

A

The browser can render a vector image at any size