CSS Flashcards

1
Q

What are the four components of “the Cascade”

A

Source order, inheritance, !important, specificity

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

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

A

The lower styling code blocks take priority than those above

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

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

A

By using inheritance to pass down properties to the children

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

List the three selector types in order of increasing specificity.

A

class, type, id

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

Why is using !important considered bad practice

A

it can messes with the natural order of cascading style sheets and debugging.

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

What are the names of individual pieces of a css rule

A

declaration blocks

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

How do you select elements by their class attribute

A

.class-name by using the .

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

How do you select elements by their type

A

tag-name just by using their tag name although it’s not recommended

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

How do you select an element by its id attribute

A

id-name by using an octothrope

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

Name three different types of values you can use to specify colors in CSS

A

rgb, lexicon values, and names

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

What CSS properties make up the box model?

A

Boxes model is a box made up of the margin, padding, and content

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

What is a pseudo-class

A

They target (or select) specific states of the element and change them based on what’s in the code block

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

What are CSS pseudo-classes useful for?

A

If you want to change specific areas in the css instead of the creating multiple classes, for example lists if you want to change the color of every other list item then there’s a pseudo class for that

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

Name at least two units of type size in CSS

A

px or rem

17
Q

What CSS property controls the font used for the text inside an element?

A

font-family

18
Q

What is the default flex-direction of a flex container?

A

row

19
Q

What is the default flex-wrap of a flex container

A

no-wrap

20
Q

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

A

The div takes up the entire width of the page

21
Q

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

A

row

22
Q

What does the transform property do?

A

Allows you to rotate, translate, skew the element

23
Q

Give four examples of CSS transform functions

A

translate, scale, rotate, skew

24
Q

The transition property is shorthand for which four css properties?

A

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

25
Q

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

A

the width and height feature

26
Q

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

A

the tag that contains the viewport

27
Q

What is the breakpoint in responsive Web design?

A

Creating a layout that looks good on all devices

28
Q

What is the advantage of using a percentage width instead of a fixed width for a column class in a responsive layout

A

It measures the width of the entire page and changes according to how the page shrinks or enlarges

29
Q

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

A

because of CSS cascading