CSS Flashcards

1
Q

What CSS properties make up the box model?

A

margin, border, padding, content

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 specifies a special state of the selected element

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

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

A

em, px

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

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

A

font-family

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

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

A

row; left to right

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

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

A

nowrap; all items on one line

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

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

A

they are block elements

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

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

A

row; left -> right

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

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

A

container, row, column

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
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
13
Q

What is the purpose of a container?

A

To be able to control the base layout of the page from one class.

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

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

A

No effect

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

static

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

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

A

they are removed from document flow

17
Q

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

A

It will overlap with other elements

18
Q

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

A

position relative on an ancestor

19
Q

What are the four box offset properties?

A

top, right, bottom, left

20
Q

What are the four components of “the Cascade”.

A

source order, inheritance, specificity, !important

21
Q

What does the term “source order” mean with respect to CSS?

A

Lower is stronger in css sheet

22
Q

How is it possible for the styles of an element to be applied to its children as well without an additional CSS rule?

A

> or inheritable elements

23
Q

List the three selector types in order of increasing specificity.

A

element(type) => class => id

24
Q

Why is using !important considered bad practice?

A

It overrides everything

25
Q

The transition property is shorthand for which four CSS properties?

A

transition-property, transition-duration, transition-timing-function, transition-delay

26
Q

What does the transform property do?

A

Allows you to rotate, scale, skew or move an element

27
Q

Give four examples of CSS transform functions.

A

rotate, skew, scale, matrix

28
Q

Give two examples of media features that you can query in an @media rule.

A

min-width

29
Q

Which HTML meta tag is used in mobile-responsive web pages?

A

<meta></meta>

30
Q

What is a breakpoint in responsive Web design?

A

The point when a screen changes size

31
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

Using px will only work for the first layout you make, % will work for all

32
Q

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”.

A

Put smaller first