LFZ CSS Quiz Flashcards

1
Q

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

A

Declarations

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

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

(name of 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

(name of id)

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

What CSS properties make up the box model?

A

Margin, Border, Padding, Content

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

What is a pseudo-class?

A

a selector that specifies a special state of the selected element(s)

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

What are CSS pseudo-classes useful for?

A

Styling elements based on states or intractability

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

Name at least two units of type size in CSS.

A

em, pt, px, percent

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

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

A

once the positioned element has taken its place in the normal flow, you can then modify its final position

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 where it appears on the page?

A

It appears like position: static, until you add some box offset properties.

17
Q

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

A

The element is removed from the document flow

18
Q

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

A

it is removed from the document flow and sits on top of everything.

19
Q

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

A

set the containing element’s position property to anything except static

20
Q

What are the four components of “the Cascade”.

A

Source order, inheritance, specificity, and !important

21
Q

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

A

the order that your CSS rules are written in your stylesheet. The styling provided for an element last in your stylesheet is the styling that will ultimately take effect.

22
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

set the property’s value to inherit.

23
Q

List the three selector types in order of increasing specificity.

A

element selector, class selector, id selector

24
Q

Why is using !important considered bad practice?

A

Because it makes debugging harder as it disrupts the natural order of the “Cascade”

25
Q

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

A

min-width, max- width

26
Q

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

A

viewport

27
Q

The transition property is shorthand for which four CSS properties?

A

transition-property, transition-duration, transition-timing-function, and transition-delay

28
Q

What is a breakpoint in responsive Web design?

A

The point at which the page changes

29
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

changes in the width of the browser scale with the percentage

30
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

Because rules created lower in the code override higher ones