CSS Flashcards

1
Q

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

A

CSS Selectors

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

Use a . before name of the class

example: .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

Use the name of the element followed by the curly braces

example: body { }

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

Use a # before the name of the ID

example: #id-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

RGB, RGBA, HSL, HSLA

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, Border, Padding, width, height

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 Property

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 Property

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

What is a psuedo-class?

A

a selector that selects elements that are in a specific state, i.e. they are the first element of their type, or they are being hovered by a mouse pointer.

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

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

For example, 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
11
Q

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

A

Pixels, percentages, ems, rems

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 and takes the full width of the content resulting in the divs stacking on one another.

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 the display: flex?

17
Q

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

18
Q

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

A

does not affect document flow

19
Q

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

A

DOES NOT change position without using: top, bottom, left, right properties in CSS.

20
Q

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

A

it gets ignored by best of document, all surround elements ignore the absolute, everything shifts to fill

21
Q

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

A

sets position to relative, goes to first ancestor without STATIC position (relative) and sticks to that.

22
Q

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

A

set ancestor to something other than STATIC

23
Q

What are the four box offset properties?

A

top, bottom, left, right

24
Q

What does the transform property do?

A

The transform CSS property lets you rotate, scale, skew, or translate an element. It modifies the coordinate space of the CSS visual formatting model.

25
Give four examples of CSS transform functions.
transform: matrix transform: translate transform: scale transform: rotate transform: skew
26
The transition property is shorthand for which four CSS properties?
transition-property, transition-duration, transition-timing-function, transition-delay
27
What is a breakpoint in responsive Web Design?
The point at which a media query is introduced
28
What is the advantage of using a percentage(e.g. 50%) width instead of a fixed (e.g. px) width for a "column" in a responsive layout?
Its relative to its parent and will change sizes based on its parent's sizing
29
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?
Source Order