CSS Flashcards

1
Q

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

A

The CSS Selector, Declaration block, property and 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

To select by class attribute you use the dot operator e.g. ‘.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 type?

A

To select an element by type you use it as the selector e.g. ‘h1’.

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

To select an element by ID you use ‘#’ e.g. ‘#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

You can specify colors with Hex, rgba(), and keywords.

Hsl() is also an option.

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

What is a pseudo-class?

A

A psuedo-class is used to define special states of an element. e.g. ‘:hover’.

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

What are CSS pseudo-classes useful for?

A

Pseudo classes are useful for decorating smaller scale, reactive parts of an element.

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

What CSS properties make up the box model?

A

The box model properties are: Margin, Border, Padding, and Content.

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

Which CSS property pushes boxes away from each other?

A

The Margin property pushes boxes away from each other.

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

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

A

The Padding property adds space between a box’s content and its border.

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

Name at least two units of type size in CSS.

A

Font size can use all ‘length’ units. e.g. ‘em, px, %, pt’.

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

The Font-family property controls the font used for an element.

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

The default value for flex-direction is ‘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

The default value of flex-wrap is ‘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

Div elements vertically stack because their display type is ‘block’.

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

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

A

The default value of position is ‘static’.

17
Q

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

A

Setting the value of position to ‘relative’ will not affect document flow.

18
Q

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

A

Setting the value of position to ‘relative’ will not affect where it appears on the page.

19
Q

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

A

Setting the value of position to ‘absolute’ will remove the element from document flow.

20
Q

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

A

Setting the value of position to ‘absolute’ will place the element at the top of its container.

21
Q

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

A

An absolutely positioned element will be constrained to any other container with a value other than ‘static’.

22
Q

What are the four box offset properties?

A

The four box offset properties are: top, right, bottom, left.