CSS Flashcards

1
Q

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

A

Selector, declaration, 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 theirclassattribute?

A

Period, class name

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

Element name

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 itsidattribute?

A

Hashtag, class name

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

Width, height, padding, border, margin

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

Keyword added to a selector that 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

Applying a style to an element in relation to the content of the document tree and to external factors i.e. history of navigator, status of content or position of mouse

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

Pixels, EMs, percentages

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

Nowrap

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

Div is a block element with a default width of 100%, placing another div naturally goes under the other to take up its’ own width of 100%

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

What is the defaultflex-directionof an element withdisplay: flex?

A

Row

17
Q

What is thedefaultvalue for thepositionproperty of HTML elements?

A

Static

18
Q

How does settingposition: relativeon an element affect document flow?

A

Does not change document flow

19
Q

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

A

Stays in the same spot

20
Q

How does settingposition: absoluteon an element affect document flow?

A

Takes the element out of document flow

21
Q

How does settingposition: absoluteon an element affect where it appears on the page?

A

Sits in the top left corner of its ancestor element

22
Q

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

A

Setting a containing blocks position to anything but static

23
Q

What are the four box offset properties?

A

Top, left, bottom, right

24
Q

What does the transform property do?

A

Lets you rotate, scale, skew, or translate an element.

25
Q

Give four examples of CSS transform functions

A

Matrix, translate, scale, rotate, skew

26
Q

Thetransitionproperty is shorthand for which four CSS properties?

A

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

27
Q

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

A

Width and height

28
Q

What is abreakpointin responsive Web design?

A

The “point” at which a website’s content and design will adapt in a certain way in order to provide the best possible user experience

29
Q

What is the advantage of using a percentage (e.g.50%)widthinstead of a fixed (e.g.px)widthfor a “column” class in a responsive layout?

A

The width is based on the percentage of its’ parent element

30
Q

If you introduce CSS rules for a smallermin-widthafterthe styles for a largermin-widthin your style sheet, the CSS rules for thesmallermin-widthwill “win”. Why is that?

A

Source order