CSS Flashcards

1
Q

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

A

declaration block, selector, property, value

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

.name of the class

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

name of the tag

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

name of the id

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

color codes, color name, and rgb values.

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

height, width, border, margin, and padding

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

a selector that chooses elements that are in a specific state.

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

To make things easier for us when we are coding and want to choose something specific.

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 and 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 should you use to resize font?

A

rem not em.

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

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

A

flex

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

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

A

wrap

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

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

A

it’s a block element (block elements can’t be next to each other. inline elements can be together.)

17
Q

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

A

row

18
Q

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

A

container, column, and row

19
Q

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

A

1

20
Q

What is the purpose of a container?

A

To group rows and columns easier. (basically an outline.)

21
Q

What is the purpose of a row class?

A

they’re vertical chunks of the page. (sectioning off different parts of the container.)

22
Q

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

A

static

23
Q

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

A

it has no effect on document flow. you can move it anywhere.

24
Q

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

A

move relative to where it would normally exist in static form.

25
Q

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

A

it disappears from the document flow.

26
Q

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

A

its boundaries are set by the container it is set in.

27
Q

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

A

it goes to the first non static ancestor. (AKA position: relative;)

28
Q

What are the four box offset properties?

A

top, bottom, left, and right

29
Q

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

A

min width and max width.

30
Q

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

A
31
Q

What is a breakpoint in responsive Web design?

A
32
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