CSS Flashcards

1
Q

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

css-syntax

A

Selector and Declaration block (which contains a 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 an element by its id attribute? (css-syntax)

A

You use a “#” (octothorp) before the id name

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

What are 3 examples of shorthand properties? (css-syntax)

A

Padding, Margin, Border.

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

Name three different types of values you can use to specify colors in CSS. (css-colors)

A

Name, #code, RGB, HSL

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

Which CSS property adds space between a box’s content and its border? (css-box-model)

A

Padding

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? (css-box-model)

A

Padding, Margin, Border, and 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? (css-box-model)

A

Margin

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

Which CSS property adds space between a box’s content and its border? (css-box-model)

A

Padding

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

What is a pseudo-class?

css-pseudo-classes

A

A keyword added to a CSS selector that specifies a special state of the selected element(s) and adds functionality to it.

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

What are CSS pseudo-classes useful for? (css-pseudo-classes)

A

They allow you to change the appearance of elements when users interact with them.

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.

css-fonts

A

Px, rem, %, em

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

What CSS property controls the font size used for the text inside an element? (css-fonts)

A

font-size

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? (css-flexbox)

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? (css-flexbox)

A

No wrap

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

What does Align content do? (css-flexbox)

A

Aligns all the content within flexbox elements on the cross-axis.

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

What does Align-items do (css-flexbox)

A

Adjusts the rows themselves on the cross -axis

17
Q

Why do two div elements “vertically stack” on one another by default? (css-layout-classes)

A

Because they are block elements.

18
Q

What is the default flex-direction of an element with display: flex? (css-layout-classes)

A

Row. (To the right).

19
Q

How do write random text-content? (css-layout-classes)

20
Q

What are utility classes? (css-layout-classes)

A

Classes that tell you what they do in the name (ex) .column-third.

21
Q

What are semantic classes? (css-layout-classes)

A

classes that don’t tell you what they do in the name. (Ex .character)

22
Q

How does setting position: absolute on an element affect where it appears on the page? (css-positioning)

A

It is positioned to the top-left of it’s closest positioned ancestor, if any; otherwise, it is placed relative to the initial containing block.

23
Q

What is the default value for the position property of HTML elements? (css-positioning)

24
Q

What are the four box offset properties? (css-positioning)

A

top, bottom, left, right

25
What are the four components of "the Cascade". | css-cascade
Source order, inheritance, specification, and !important.
26
What does the term "source order" mean with respect to CSS? | css-cascade
Code lower in the stylesheet get priority if they are the same relevance.
27
How is it possible for the styles of an element to be applied to its children as well without an additional CSS rule? (css-cascade)
inheritance.
28
List the three selector types in order of increasing specificity. (css-cascade)
element, class, id.
29
Why is using !important considered bad practice? | css-cascade
Makes it harder to debug.
30
What does the transform property do? | css-transforms
Lets you rotate, scale, skew, or translate (etc.) an element
31
Give four examples of CSS transform functions. | css-transforms
rotate, scale, skew, translate, matrix.
32
Give two examples of media features that you can query in an @media rule. (css-media-queries)
min-width, max-width
33
Which HTML meta tag is used in mobile-responsive web pages? (css-media-queries )
HTML viewport meta tag.
34
What is a breakpoint in responsive Web design? | css-responsive-layout
The point where new styling gets applied to a document.
35
``` 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? (css-responsive-layout) ```
percentage is far more flexible.
36
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? (css-responsive-layout)
Source order is a huge factor.
37
Where should media queries go? | css-responsive-layout
At the bottom of your css stylesheet