Responsive Layouts Flashcards

1
Q

By default, are websites static or responsive?

A

By default, websites are usually responsive. It’s when you come into to CSS with set values, it create issues.

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

Why is it best to work with percentages?

A

Working with percentages makes the website automatically responsive. It makes creating responsive websites much easier.

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

how does the child interact with the parent element with percentages.

A

Whatever percentage is set for the parent, the child is the percent of the parent.

For example: You set the parent width as 80%. Then you set the child’s width at 50%. The child is the 50% of the parent’s width. It is NOT 50% of the viewport (window).

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

Why is it a good idea to avoid heights when creating a responsive website?

A

Using height causes more issues than they solve. Using height causes content to overflow and it’s get hidden. Turning off the height makes it become responsive. It adapts to whatever percentage that you’re working with.

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

If it’s not recommended to use height when working on a responsive site, what alternative that you can use?

A

If you need more background, use padding. Make sure to use responsive properties such as em or rem.

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

What are media queries and what is the basic syntax?

A

Media queries let us add new styles that target only specific conditions. Syntax is @media media-type and (media-features) { … }

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

What does this media query telling you?

@media (min-width: 400px) {
    body {
       background: purple;
    }
}
A

this media query is saying that from a minimum width of 400px and bigger, turn the background color to purple

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

What are the media type that media queries let us target?

A
  • Screen @media screen { … }
  • Print @media print { … }
  • Speech @media speech { … }
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

When should the media queries come after on the css stylesheet?

A

Media queries should always come after the DEFAULT selector that you already have.

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

What CSS property can you use to remove the white space on top of a header?

A

Padding

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

How do you center a menu in a navigation bar?

A

To center a menu (or list), you can use display: flex, justify-content: center;

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

What is another way that you can center text besides using flexbox?

A

margin: 0 auto;

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