10 Responsive Design Principles Flashcards

1
Q

Make element change size with viewport if it is larger or smaller than a certain size

A
@media (max-width: 350px) {
    :root {
      --penguin-size:200px;
      --penguin-skin: black;
    }
  }

When the frame becomes smaller than 350px, the black will take precedence.

max- means if the frame size is less than or equal to the number, apply the block styles
min- means if the frame size is greater than or equal to the number, apply the block styles

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

Make image a certain proportion of the viewport and change size with the viewport.

A

img {
max-width: 100%;
height: auto;
}

max-width:10% means 10% of its container

so it will never be larger than the frame
height auto to make the image proportional (though it seems to do that anyway)

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

How to prepare for a 300ppi + monitor?

A

Make the image half it’s actual resolution

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

make type responsive to viewport size (make the text frame, but not font-size, change with viewport size)

A

p {
width: 30vw;
}
30% of the viewport width (can be greater than 100)

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

what are some relative viewport unit measurements
(useful if you need to make the height change with the width??)
(4)

A

vw (viewport width): 10vw would be 10% of the viewport’s width.

vh (viewport height): 3vh would be 3% of the viewport's height.

vmin (viewport minimum): 70vmin would be 70% of the viewport's smaller dimension (height or width).

vmax (viewport maximum): 100vmax would be 100% of the viewport's bigger dimension (height or width).
How well did you know this?
1
Not at all
2
3
4
5
Perfectly