CSS Flashcards

1
Q

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

A

rule selector, declaration block, property, value,

if there is a function in the value, read as css function (name of element) with an argument of (name of argument

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

.class name

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 type?

A

just name of the element

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

(pound sign).name of 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

RGB values, hex codes, and color 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

border, margin, 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

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

A

pixels, REM, etc (EMS, percentage)

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

What is a pseudo-class?

A

a selector that selects elements that are in a specific state
(:hover, :nth-child(), etc)

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

What are CSS pseudo-classes useful for?

A

for developers, it is useful when there are repetitive works in css and give web visitors more convenience.

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

no-wrap

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

because div is a block element which takes full block

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

left to right (row)

17
Q

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

18
Q

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

A

act like a normal flow but allow you to position of the elements

19
Q

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

A

lay on exact same spot if no box offset

20
Q

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

A

it becomes independent from the other relative position

no longer a normal flow

21
Q

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

A

if no box offset, top left corner of the ancestor element

22
Q

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

A

have relative position as a parent of the block (not static)

23
Q

What are the four box offset properties?

A

top, bottom, right, left