CSS Flashcards

1
Q

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

A

color names, or RGB, HEX, HSL, RGBA, HSLA values.

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

What CSS properties make up the box model?

A

margin, border, padding, content

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

Which CSS property pushes boxes away from each other?

A

The margin CSS property pushes boxes away from each other

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

Which CSS property adds space between a box’s content and its border?

A

The CSS property that adds space between a box’s content and its border is the padding property

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

What is a pseudo-class?

A

A pseudo-class is used to define a special state of an element.

it can be used to:

Style an element when a user mouses over it
Style visited and unvisited links differently
Style an element when it gets focus

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

What are pseudo-classes useful for?

A

A pseudo-class is used to define a special state of an element.

it can be used to:

Style an element when a user mouses over it
Style visited and unvisited links differently
Style an element when it gets focus

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

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

A

pixels, em, percentages

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

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

A

The CSS property that controls the font used for the text inside an element is the font-family property

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

What is the default flex-direction of a flex container

A

The default flex-direction of a flex container is left to right, in a row

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

What is the default flex-wrap of a flex-container

A

By default, flex items will all try to fit onto one line. You can change that and allow the items to wrap as needed with this property.

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

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

A

Two div elements vertically stack on one another by default because div elements are block elements

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

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

A

The default flex-direction of an element with display: flex is from left to right, in a row

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

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

A

The default position property for HTML elements is static

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

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

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

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

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

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

A
17
Q

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

A
18
Q

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

A
19
Q

what are the four box offset properties?

A
20
Q

What are the four components of the Cascade?

A

Specificity, inheritance, source order

21
Q

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

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

It’s possible for (some of) the styles of an element to be applied to its children without an additional CSS rule because of the concept of inheritance

23
Q

List three selector types in order of increasing specificity

A
universal
element selector
class selector
element class selector
ID selector
24
Q

Why is using !important considered bad practice?

A
25
Q

What does the transform property do?

A

The transform property applies a 2D or 3D transformation to an element. This property allows you to rotate, scale, move, skew, etc., elements.

26
Q

Give four examples of CSS transform functions

A

The transform property applies a 2D or 3D transformation to an element. This property allows you to rotate, scale, move, skew, etc., elements.

27
Q

The transition property is shorthand for which four CSS properties?

A
transition:
transition-delay
transition-duration
transition-property
transition-timing-function
28
Q

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

A

min-width, max-width, orientation

29
Q

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

A

The viewport meta tag

30
Q

What is the breakpoint in responsive web design?

A

The breakpoint in responsive web design is the point where you want your design to adapt to the display size

It’s a point where you want your design to adapt to a specific media feature: @media only screen and (min-width: breakpoint in pixels)

Typically viewport width

31
Q

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

A

Pixels are fixed and screen sizes vary

Percentages adapt and display relative to screen size

Responds to the parent container

32
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

The CSS rule for the smaller min0width will win because it is the last bit of code in the cascading style sheet

Because of the source order