CSS Flashcards

1
Q

Names of the CSS rule pieces:

A
  1. Selector
  2. Opening/ closing braces
  3. Properties
  4. Property values
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

How do you select elements by their class attribute?

A

You place a .class in the selector

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

How do you select elements by type

A

you place the element type in the selector position

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

how do you select an element by it’s ID?

A

Use #idName

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

Name three types of values to specify colors:

A

hex numbers, rgba, and specific 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, borders, padding, content size. 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.

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 it’s border?

A

padding.

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

What is a psuedo-class?

A

A psuedo-class is 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

psuedo-class used for?

A

It’s helpful for making elements on your page respond to interaction

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

Name two units of font size:

A

em, rem, px.

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

div elements are block elements that do not share lines

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 an element affect document flow?

A

it does not interrupt flow but the element remains in the flow

19
Q

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

A

It appears relative to its original static position.

20
Q

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

A

It removes it from the flow and places it in an exact position.

21
Q

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

A

It will place an element exactly where you want it, regardless of whether it clashes with other elements.

22
Q

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

A

the nearest non static ancestor element will contain and absolute element. Create a block with relative positioning and it will serve as a container.

23
Q

What are the four box offset properties?

A

top, bottom, left, and right

24
Q

What are the four components of “the Cascade”.

A

Importance, specificity, source order, proximity

25
Q

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

A

The order property is designed to lay the items out in ordinal groups. What this means is that items are assigned an integer that represents their group. The items are then placed in the visual order according to that integer, lowest values first. If more than one item has the same integer value, then within that group the items are laid out as per source order.

26
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

you can put two element in the selector group. without a comma, it selects the child element

27
Q

List the three selector types in order of increasing specificity.

A

.class, #id, inline

28
Q

Why is using !important considered bad practice?

A

It overrides the other classes and ID’s. It makes debugging more difficult because it breaks normal css.