CSS Flashcards

1
Q

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

A

Selector declaration block 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

.classname

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

In CSS, how do you select an element by its id attribute?

A

idname

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

In CSS, how do you select elements by their type?

A

elementname

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 names hexcodes rgb

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

padding border margin

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

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 CSS pseudo-classes useful for?

A

more direct and efficient

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

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

theyre block elements

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

horizontal/row

17
Q

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

A

styling that is lower in the styling sheet takes priority

18
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

inheritance where child can use styling from parent elements if it hast been used

19
Q

List the three selector types in order of increasing specificity.

A

type class id

20
Q

Why is using !important considered bad practice?

A

no reason for it

21
Q

What does the transform property do?

A

rotate scale skew or translate an image

22
Q

Give four examples of CSS transform functions.

A

rotate scale skew or translate matrix

23
Q

The transition property is shorthand for which four CSS properties?

A

transition-delay
transition-duration
transition-property
transition-timing-function

24
Q

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

A

min-width,max-height

25
Q

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

A

viewport

26
Q

What is a breakpoint in responsive Web design?

A

when the content and design starts to adapt in a certain to fit the user experience

27
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

adapts to exact dimensions of page

28
Q

If you introduce CSS rules for a smaller min-width after the styles for a larger min-width in your style sheet, the CSS rules for the smaller min-width will “win”. Why is that?

A

bottom would win cause of source order