CSS day 2 & 3 Flashcards

1
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
2
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
3
Q

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

A

because divs are block elements

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

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

A

row

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

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

A

The default position is static for any html element if not specified explicitly. static is always the initial value for the CSS property position no matter which tag.

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

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

A

Relative positioning moves an element in relation to where it would have been in normal flow.

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

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

A

This moves an element from the position it would be in normal flow, shifting it to the top, right, bottom, or left of where it would have been placed.

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

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

A

When the position property is given a value of absolute, the box is taken out of normal flow and no longer affects the position of other elements on the page. (They act like it is not there.)

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

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

A

This positions the element in relation to its containing

element.

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

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

A

absolute, relative, and fixed. (anything other than static)

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

What are the four box offset properties?

A

top, bottom, left, right

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

What are the four components of “the Cascade”.

A

Source order, Inheritance, Specificity, Important

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

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

A

The order that your CSS rules are written in your stylesheet. The styling provided for an element last in your stylesheet is the styling that will ultimately take effect.

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

due to CSS Inheritance. When no value for an inherited property has been specified on an element, the element gets the computed value of that property on its parent element.

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

List the three selector types in order of increasing specificity.

A

Type selectors, Class, selectors, ID selectors.

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

Why is using !important considered bad practice?

A

it makes debugging more difficult by breaking the natural cascading in your stylesheets

17
Q

What does the transform property do?

A

The transform property applies a 2D or 3D transformation to an element.

18
Q

Give four examples of CSS transform functions.

A

This property allows you to rotate, scale, move, skew, etc., elements.

19
Q

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

A

any-hover, color-index

20
Q

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

A

viewport meta tag

21
Q

The transition property is shorthand for which four CSS properties?

A

The transition CSS property is a shorthand property for transition-property, transition-duration, transition-timing-function, and transition-delay.

22
Q

What is a breakpoint in responsive Web design?

A

Breakpoints are the point a which your sites content will respond to provide the user with the best possible layout to consume the information.

23
Q

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?

A

using % makes the site responsive. The main advantage of the use of percentage is the possibility of designing for all the resolutions with no need to make different versions for the Web.

24
Q

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?

A

due to source order.