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

dot (.)

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 tag name?

A

name of the element (element selector)

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

pound/hashtag (#)

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, Hex, Color names, Hue, Saturation (Amount of gray in a color), Brightness (How much black is in a color).

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

Border, Margin, and Padding

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

Its a keyword added to a selector

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

It allows the users to have a better interaction/engagement with the browser.
Better functionality

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

Name two types of units that can be used to adjust font-size in CSS.

A

px, percentages, rem (changes the width of the letter m)

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 (nowrap)

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

No change

17
Q

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

A

There is no change.

18
Q

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

A

It acts if it doesn’t exist in the document flow
It won’t have an affect on other elements

19
Q

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

A

It appears on the top left

20
Q

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

A

Any non static position property

21
Q

What are the four box offset properties?

A

top, bottom, right, left

22
Q

What are the four components of “the Cascade”.

A

specificity, source order, inheritance, and importance.

23
Q

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

A

When there is styling for an element of the same property, the last one on the stylesheet will be applied.

24
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

25
Q

List the three selector types in order of increasing specificity.

A

type < class < id

26
Q

Why is using !important considered bad practice?

A

!important will reverse the cascade order of stylesheets.
It can interrupt the work flow of other developers if they’re working on the code. if !important is used.
If it’s used, a comment should be left on why it was used.

27
Q

What does the transform property do?

A

Transform property lets you rotate, scale, skew, or translate an element. It modifies the coordinate space of the css.

28
Q

Give four examples of CSS transform functions.

A

4 CSS transform functions: rotate(), translateY(), scale(), skew(), matrix(),

29
Q

The transition property is shorthand for which four CSS properties?

A

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

30
Q

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

A

color
width

31
Q

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

A

viewport