CSS Flashcards

1
Q

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

A

The selector and declaration block.

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

You put a . in front of the 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 type?

A

The 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

in front of the attribute.

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

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

Margins, borders, padding, and the content.

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 keyword added to a selector that specifies a special state of the selected element.

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

Styling an element when a user mouses over it. Makes the web page feel more interactive.

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

Px and em

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

They are block elements, so they take up the width of their container.

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

What does the transform property do?

A

Rotates, scales, skews or translates an element.

17
Q

Give four examples of CSS transform functions.

A

Rotate, scale, translate, skew.

18
Q

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

A

Static

19
Q

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

A

Moves an element from the position it would be from normal flow, and doesn’t affect the positioning of surrounding elements.

20
Q

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

A

It allows us to move the element.

21
Q

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

A

No longer exists in normal document flow. Positions the element in relation to its containing element.

22
Q

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

A

Absolutely positioned elements move as users scroll up and down the page.

23
Q

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

A

Non-static ancestor elements.

24
Q

What are the four box offset properties?

A

top, bottom, left, and right