CSS Flashcards

1
Q

What are the names of the individual pieces of a CSS rule?

A

Selector

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

In CSS, how do you select elements by their class attribute?

A

with a .

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

In CSS, how do you select elements by their tag name?

A

tag name and {}

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

In CSS, how do you select an element by its id attribute?

A

with a #

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

Name three different types of values you can use to specify colors in CSS.

A

RBG, HEX, and by name

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

What CSS properties make up the box model?

A

content, padding, border, margin

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

What is a pseudo-class?

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
10
Q

What are CSS pseudo-classes useful for?

A

changing styling when a user is interacting with an element

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

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

A

rem, px

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

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

A

bc they’re block elements

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

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

A

row

17
Q

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

A

container, column, row

18
Q

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

A

1

19
Q

What is the purpose of a container?

A

to set the boundaries of the content

20
Q

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

A

static

21
Q

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

A

its unaffected

22
Q

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

A

It would move relative to its original position

23
Q

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

A

It’s removed from the document flow entirely

24
Q

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

A

It is positioned against the nearest non static parent

25
Q

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

A

assign position relative, absolute, or fixed to the static containing block

26
Q

What are the four box offset properties?

A

top bottom left right

27
Q

What are arrays used for?

A

to store a list of information when order matters OR doesn’t

28
Q

Describe array literal notation.

A

var = array[1,2,3]

29
Q

How are arrays different from “plain” objects?

A

arrays mostly all have the same datatype, also have a length property automatically

30
Q

What number represents the first index of an array?

A

0

31
Q

What is the length property of an array?

A

how many items are inside the array

32
Q

How do you calculate the last index of an array?`

A

length-1

33
Q

What does the transform property do?

A

lets you adjust how the element gets rendered

34
Q

Give four examples of CSS transform functions.

A

rotate, scale, translate, skew

35
Q

The transition property is shorthand for which four CSS properties?

A

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

36
Q

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

A

min-width, max-width

37
Q

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

A

meta tag