CSS Flashcards

(25 cards)

1
Q

What CSS properties make up the box model?

A

Margin, Padding, and border

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

Which CSS property pushes boxes away from each other?

A

Margin

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

Which CSS property add space between a box’s content and its border?

A

Padding

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

What is a pseudo-class?

A

It is a keyword added to a selector that specifies a special state of the selected element(s)

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

What are CSS pseudo-classes useful for?

A

Add functionality

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

Name two types of units that can be used to adjust font-size in CSS

A

Px, Ems

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

What CSS property controls the font used for the text inside an element?

A

font-family property

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

What is the default flex-direction of a flex container?

A

Row

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

What is the default flex-wrap of a flex container?

A

Nowrap

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

Why do two div elements “vertically stack” on one another by default?

A

Because its a block element

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

What is the default flex-direction of an element with display: flex?

A

Row

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

What are the three primary components of a page layout? (Which helper classes do you need?)

A

Container, row, and column

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

What is the minimum number of columns that you should put in a row

A

1

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

What is the purpose of a container?

A

To “contain” the entire layout and give the whole layout a minimum width. Make the layout organized.

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

What is the default value for the position property of HTML elements?

A

position: static;

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

How does setting position: relative on an element affect document flow?

A

It would not affect

17
Q

How does setting position: relative on an element affect where it appears on the page?

A

THere is no inherit change

18
Q

How does setting position: absolute on an element affect document flow?

A

Remove from the document flow.

19
Q

How does setting position: absolute on an element affect where it appears on the page?

A

It depends on the non-statically positioned parent it will position itself against and any box offset properties

20
Q

How do you constrain an absolutely positioned element to a containing block?

A

Use the position: relative property in the containing block

21
Q

What are the four box offset properties?

A

Top, bottom, left, right

22
Q

The transition property is shorthand for which four CSS properties?

A

transition-delay: 250ms;
transition-duration: 2s;
transition-property: all, height, color;
transition-timing-function: linear;

23
Q

What is a breakpoint in responsive Web design?

A

The point in which the CSS updates for us. Ex: if the screen gets to 500px, the element changes its width

24
Q

What is the advantage of using a percentage (e.g. 50%) width instead of a fixed (e.g. px) width for a “column” class in a responsive layout?

A

It allows them to grow and contract with the web page as it moves between the break points.

25
If you introduce CSS rules for a smaller min-width after the styles for a larger min-width in your style sheet, the CSS rules for the smaller min-width will "win". Why is that?
Because its the final one in the source order. So for the media query, its better to start from the smaller width to the bigger ones. (ex: min-width: 576px)