CSS Flashcards

1
Q

what are the names of the individual pieces of a css rule?

A

selector, declaration

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 elements by their type?

A

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

IDname

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

name 3 different types of values you can use to specify colors in css

A

rbg values, hex codes, color names.

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

margin, padding, border

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 adds 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 the selected 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

changing styles based on user interaction

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

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

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

row

17
Q

what is the default value for the position property of HTML elements?

A

static

18
Q

how does setting position:relative on on element affect document flow?

A

doesn’t move other elements

19
Q

how does setting position:relative on an element affect where it appears on a page?

A

appears in relation to its original position

20
Q

how does setting position:absolute on an element affect where it appears on a page?

A

it is positioned within the first non-static ancestor.

21
Q

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

A

by setting the block position to anything other than static.

22
Q

what are the 4 offset properties?

A

top, bottom, left, right

23
Q

what are the 4 components of “the cascade”?

A

source order, inheritance, specificity & !important

24
Q

what does the term ‘source order’ mean with respect to css?

A

the order in which css rules are written. last styling for an element will take effect

25
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

certain properties are automatically inherited by child elements. mostly font properties

26
Q

list 3 selector types in order of increasing specificity

A

type selector, class selector, id selector

27
Q

why is using !important considered bad?

A

makes debugging more difficult by breaking the natural cascading in the stylesheet

28
Q

what does the transform property do?

A

modifies the coordinate space of the css visual formatting model.

29
Q

give 4 examples of css transform functions

A

rotate, scale, skew, translate

30
Q

the transition property is shorthand for which 4 css properties?

A

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

31
Q

give 2 examples of media features that you can query in an @media rule

A

min-width, max-width

32
Q

which html meta tag is used in mobile responsive web pages?

A

viewport

33
Q

what is a breakpoint in responsive web design?

A

the point at which a media query is introduced

34
Q

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

A

flexible, will shrink and grow with the browser.