css Flashcards

1
Q

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

A

declaration block, properties, 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

.

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

their tags

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

#

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, named colors.

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

margin padding border

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 it’s 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 pseudo class is a keyword that specifies a special state of an element.

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

What are pseudo-classes useful for?

A

They are useful for applying styling to elements when certain conditions are met, for example, hovering over a button.

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

px, rem

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 text inside the element?

A

font-family

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

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

A

Because they are block elements.

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

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

A

row

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

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

A

static

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

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

A

It does not affect document flow for other elements.

17
Q

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

A

It changes it’s position relative to where it would have been in static flow.

18
Q

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

A

It is treated as if it does not exist in document flow.

19
Q

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

A

It positions itself relative to the nearest non static element on the page according to its positional CSS properties.

20
Q

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

A

You set one of it’s parent elements to a position other than static, and absolute.

21
Q

What are the four box offset properties?

A

top, bottom, left, right

22
Q

What does the term source order mean with respect to CSS?

A

The order rule sets and properties appear on a page

23
Q

How is it possible for the styles of an element to be applied to its children as well without an additional CSS rule?

A

inheritence

24
Q

List the three selector types in order of increasing specificity.

A

universal selector class selector id selector

25
Q

Why is using !important considered bad practice?

A

it overrides the cascading nature of stylesheets, destroying reusability.

26
Q

The transition property is shorthand for which four CSS properties?

A

transition-duration transition-timing-function transition-delay